57 #ifndef PY_SSIZE_T_CLEAN
58 #define PY_SSIZE_T_CLEAN
62 #error Python headers needed to compile C extensions, please install development version of Python.
63 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
64 #error Cython requires Python 2.6+ or Python 3.3+.
66 #define CYTHON_ABI "0_29_24"
67 #define CYTHON_HEX_VERSION 0x001D18F0
68 #define CYTHON_FUTURE_DIVISION 1
71 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
73 #if !defined(WIN32) && !defined(MS_WINDOWS)
85 #define DL_IMPORT(t) t
88 #define DL_EXPORT(t) t
91 #ifndef HAVE_LONG_LONG
92 #if PY_VERSION_HEX >= 0x02070000
93 #define HAVE_LONG_LONG
97 #define PY_LONG_LONG LONG_LONG
100 #define Py_HUGE_VAL HUGE_VAL
103 #define CYTHON_COMPILING_IN_PYPY 1
104 #define CYTHON_COMPILING_IN_PYSTON 0
105 #define CYTHON_COMPILING_IN_CPYTHON 0
106 #undef CYTHON_USE_TYPE_SLOTS
107 #define CYTHON_USE_TYPE_SLOTS 0
108 #undef CYTHON_USE_PYTYPE_LOOKUP
109 #define CYTHON_USE_PYTYPE_LOOKUP 0
110 #if PY_VERSION_HEX < 0x03050000
111 #undef CYTHON_USE_ASYNC_SLOTS
112 #define CYTHON_USE_ASYNC_SLOTS 0
113 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
114 #define CYTHON_USE_ASYNC_SLOTS 1
116 #undef CYTHON_USE_PYLIST_INTERNALS
117 #define CYTHON_USE_PYLIST_INTERNALS 0
118 #undef CYTHON_USE_UNICODE_INTERNALS
119 #define CYTHON_USE_UNICODE_INTERNALS 0
120 #undef CYTHON_USE_UNICODE_WRITER
121 #define CYTHON_USE_UNICODE_WRITER 0
122 #undef CYTHON_USE_PYLONG_INTERNALS
123 #define CYTHON_USE_PYLONG_INTERNALS 0
124 #undef CYTHON_AVOID_BORROWED_REFS
125 #define CYTHON_AVOID_BORROWED_REFS 1
126 #undef CYTHON_ASSUME_SAFE_MACROS
127 #define CYTHON_ASSUME_SAFE_MACROS 0
128 #undef CYTHON_UNPACK_METHODS
129 #define CYTHON_UNPACK_METHODS 0
130 #undef CYTHON_FAST_THREAD_STATE
131 #define CYTHON_FAST_THREAD_STATE 0
132 #undef CYTHON_FAST_PYCALL
133 #define CYTHON_FAST_PYCALL 0
134 #undef CYTHON_PEP489_MULTI_PHASE_INIT
135 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
136 #undef CYTHON_USE_TP_FINALIZE
137 #define CYTHON_USE_TP_FINALIZE 0
138 #undef CYTHON_USE_DICT_VERSIONS
139 #define CYTHON_USE_DICT_VERSIONS 0
140 #undef CYTHON_USE_EXC_INFO_STACK
141 #define CYTHON_USE_EXC_INFO_STACK 0
142 #elif defined(PYSTON_VERSION)
143 #define CYTHON_COMPILING_IN_PYPY 0
144 #define CYTHON_COMPILING_IN_PYSTON 1
145 #define CYTHON_COMPILING_IN_CPYTHON 0
146 #ifndef CYTHON_USE_TYPE_SLOTS
147 #define CYTHON_USE_TYPE_SLOTS 1
149 #undef CYTHON_USE_PYTYPE_LOOKUP
150 #define CYTHON_USE_PYTYPE_LOOKUP 0
151 #undef CYTHON_USE_ASYNC_SLOTS
152 #define CYTHON_USE_ASYNC_SLOTS 0
153 #undef CYTHON_USE_PYLIST_INTERNALS
154 #define CYTHON_USE_PYLIST_INTERNALS 0
155 #ifndef CYTHON_USE_UNICODE_INTERNALS
156 #define CYTHON_USE_UNICODE_INTERNALS 1
158 #undef CYTHON_USE_UNICODE_WRITER
159 #define CYTHON_USE_UNICODE_WRITER 0
160 #undef CYTHON_USE_PYLONG_INTERNALS
161 #define CYTHON_USE_PYLONG_INTERNALS 0
162 #ifndef CYTHON_AVOID_BORROWED_REFS
163 #define CYTHON_AVOID_BORROWED_REFS 0
165 #ifndef CYTHON_ASSUME_SAFE_MACROS
166 #define CYTHON_ASSUME_SAFE_MACROS 1
168 #ifndef CYTHON_UNPACK_METHODS
169 #define CYTHON_UNPACK_METHODS 1
171 #undef CYTHON_FAST_THREAD_STATE
172 #define CYTHON_FAST_THREAD_STATE 0
173 #undef CYTHON_FAST_PYCALL
174 #define CYTHON_FAST_PYCALL 0
175 #undef CYTHON_PEP489_MULTI_PHASE_INIT
176 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
177 #undef CYTHON_USE_TP_FINALIZE
178 #define CYTHON_USE_TP_FINALIZE 0
179 #undef CYTHON_USE_DICT_VERSIONS
180 #define CYTHON_USE_DICT_VERSIONS 0
181 #undef CYTHON_USE_EXC_INFO_STACK
182 #define CYTHON_USE_EXC_INFO_STACK 0
184 #define CYTHON_COMPILING_IN_PYPY 0
185 #define CYTHON_COMPILING_IN_PYSTON 0
186 #define CYTHON_COMPILING_IN_CPYTHON 1
187 #ifndef CYTHON_USE_TYPE_SLOTS
188 #define CYTHON_USE_TYPE_SLOTS 1
190 #if PY_VERSION_HEX < 0x02070000
191 #undef CYTHON_USE_PYTYPE_LOOKUP
192 #define CYTHON_USE_PYTYPE_LOOKUP 0
193 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
194 #define CYTHON_USE_PYTYPE_LOOKUP 1
196 #if PY_MAJOR_VERSION < 3
197 #undef CYTHON_USE_ASYNC_SLOTS
198 #define CYTHON_USE_ASYNC_SLOTS 0
199 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
200 #define CYTHON_USE_ASYNC_SLOTS 1
202 #if PY_VERSION_HEX < 0x02070000
203 #undef CYTHON_USE_PYLONG_INTERNALS
204 #define CYTHON_USE_PYLONG_INTERNALS 0
205 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
206 #define CYTHON_USE_PYLONG_INTERNALS 1
208 #ifndef CYTHON_USE_PYLIST_INTERNALS
209 #define CYTHON_USE_PYLIST_INTERNALS 1
211 #ifndef CYTHON_USE_UNICODE_INTERNALS
212 #define CYTHON_USE_UNICODE_INTERNALS 1
214 #if PY_VERSION_HEX < 0x030300F0
215 #undef CYTHON_USE_UNICODE_WRITER
216 #define CYTHON_USE_UNICODE_WRITER 0
217 #elif !defined(CYTHON_USE_UNICODE_WRITER)
218 #define CYTHON_USE_UNICODE_WRITER 1
220 #ifndef CYTHON_AVOID_BORROWED_REFS
221 #define CYTHON_AVOID_BORROWED_REFS 0
223 #ifndef CYTHON_ASSUME_SAFE_MACROS
224 #define CYTHON_ASSUME_SAFE_MACROS 1
226 #ifndef CYTHON_UNPACK_METHODS
227 #define CYTHON_UNPACK_METHODS 1
229 #ifndef CYTHON_FAST_THREAD_STATE
230 #define CYTHON_FAST_THREAD_STATE 1
232 #ifndef CYTHON_FAST_PYCALL
233 #define CYTHON_FAST_PYCALL 1
235 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
236 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
238 #ifndef CYTHON_USE_TP_FINALIZE
239 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
241 #ifndef CYTHON_USE_DICT_VERSIONS
242 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
244 #ifndef CYTHON_USE_EXC_INFO_STACK
245 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
248 #if !defined(CYTHON_FAST_PYCCALL)
249 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
251 #if CYTHON_USE_PYLONG_INTERNALS
252 #include "longintrepr.h"
257 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P ==
sizeof(
void*)) };
260 #ifndef __has_attribute
261 #define __has_attribute(x) 0
263 #ifndef __has_cpp_attribute
264 #define __has_cpp_attribute(x) 0
266 #ifndef CYTHON_RESTRICT
267 #if defined(__GNUC__)
268 #define CYTHON_RESTRICT __restrict__
269 #elif defined(_MSC_VER) && _MSC_VER >= 1400
270 #define CYTHON_RESTRICT __restrict
271 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
272 #define CYTHON_RESTRICT restrict
274 #define CYTHON_RESTRICT
277 #ifndef CYTHON_UNUSED
278 # if defined(__GNUC__)
279 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
280 # define CYTHON_UNUSED __attribute__ ((__unused__))
282 # define CYTHON_UNUSED
284 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
285 # define CYTHON_UNUSED __attribute__ ((__unused__))
287 # define CYTHON_UNUSED
290 #ifndef CYTHON_MAYBE_UNUSED_VAR
291 # if defined(__cplusplus)
292 template<
class T>
void CYTHON_MAYBE_UNUSED_VAR(
const T& ) { }
294 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
297 #ifndef CYTHON_NCP_UNUSED
298 # if CYTHON_COMPILING_IN_CPYTHON
299 # define CYTHON_NCP_UNUSED
301 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
304 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
306 #ifndef _MSC_STDINT_H_
308 typedef unsigned char uint8_t;
309 typedef unsigned int uint32_t;
311 typedef unsigned __int8 uint8_t;
312 typedef unsigned __int32 uint32_t;
318 #ifndef CYTHON_FALLTHROUGH
319 #if defined(__cplusplus) && __cplusplus >= 201103L
320 #if __has_cpp_attribute(fallthrough)
321 #define CYTHON_FALLTHROUGH [[fallthrough]]
322 #elif __has_cpp_attribute(clang::fallthrough)
323 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
324 #elif __has_cpp_attribute(gnu::fallthrough)
325 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
328 #ifndef CYTHON_FALLTHROUGH
329 #if __has_attribute(fallthrough)
330 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
332 #define CYTHON_FALLTHROUGH
335 #if defined(__clang__ ) && defined(__apple_build_version__)
336 #if __apple_build_version__ < 7000000
337 #undef CYTHON_FALLTHROUGH
338 #define CYTHON_FALLTHROUGH
344 #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
346 #ifndef CYTHON_INLINE
347 #if defined(__clang__)
348 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
350 #define CYTHON_INLINE inline
354 void __Pyx_call_destructor(T& x) {
358 class __Pyx_FakeReference {
360 __Pyx_FakeReference() : ptr(NULL) { }
361 __Pyx_FakeReference(
const T& ref) : ptr(const_cast<T*>(&ref)) { }
362 T *operator->() {
return ptr; }
363 T *operator&() {
return ptr; }
364 operator T&() {
return *ptr; }
365 template<
typename U>
bool operator ==(U other) {
return *ptr == other; }
366 template<
typename U>
bool operator !=(U other) {
return *ptr != other; }
371 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
372 #define Py_OptimizeFlag 0
374 #define __PYX_BUILD_PY_SSIZE_T "n"
375 #define CYTHON_FORMAT_SSIZE_T "z"
376 #if PY_MAJOR_VERSION < 3
377 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
378 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
379 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
380 #define __Pyx_DefaultClassType PyClass_Type
382 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
383 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
384 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
385 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
387 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
388 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
390 #define __Pyx_DefaultClassType PyType_Type
392 #ifndef Py_TPFLAGS_CHECKTYPES
393 #define Py_TPFLAGS_CHECKTYPES 0
395 #ifndef Py_TPFLAGS_HAVE_INDEX
396 #define Py_TPFLAGS_HAVE_INDEX 0
398 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
399 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
401 #ifndef Py_TPFLAGS_HAVE_FINALIZE
402 #define Py_TPFLAGS_HAVE_FINALIZE 0
404 #ifndef METH_STACKLESS
405 #define METH_STACKLESS 0
407 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
408 #ifndef METH_FASTCALL
409 #define METH_FASTCALL 0x80
411 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *
self, PyObject *
const *args, Py_ssize_t nargs);
412 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *
self, PyObject *
const *args,
413 Py_ssize_t nargs, PyObject *kwnames);
415 #define __Pyx_PyCFunctionFast _PyCFunctionFast
416 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
418 #if CYTHON_FAST_PYCCALL
419 #define __Pyx_PyFastCFunction_Check(func)\
420 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
422 #define __Pyx_PyFastCFunction_Check(func) 0
424 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
425 #define PyObject_Malloc(s) PyMem_Malloc(s)
426 #define PyObject_Free(p) PyMem_Free(p)
427 #define PyObject_Realloc(p) PyMem_Realloc(p)
429 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
430 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
431 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
432 #define PyMem_RawFree(p) PyMem_Free(p)
434 #if CYTHON_COMPILING_IN_PYSTON
435 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
436 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
438 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
439 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
441 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
442 #define __Pyx_PyThreadState_Current PyThreadState_GET()
443 #elif PY_VERSION_HEX >= 0x03060000
444 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
445 #elif PY_VERSION_HEX >= 0x03000000
446 #define __Pyx_PyThreadState_Current PyThreadState_GET()
448 #define __Pyx_PyThreadState_Current _PyThreadState_Current
450 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
451 #include "pythread.h"
452 #define Py_tss_NEEDS_INIT 0
453 typedef int Py_tss_t;
454 static CYTHON_INLINE
int PyThread_tss_create(Py_tss_t *key) {
455 *key = PyThread_create_key();
458 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(
void) {
459 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(
sizeof(Py_tss_t));
460 *key = Py_tss_NEEDS_INIT;
463 static CYTHON_INLINE
void PyThread_tss_free(Py_tss_t *key) {
466 static CYTHON_INLINE
int PyThread_tss_is_created(Py_tss_t *key) {
467 return *key != Py_tss_NEEDS_INIT;
469 static CYTHON_INLINE
void PyThread_tss_delete(Py_tss_t *key) {
470 PyThread_delete_key(*key);
471 *key = Py_tss_NEEDS_INIT;
473 static CYTHON_INLINE
int PyThread_tss_set(Py_tss_t *key,
void *value) {
474 return PyThread_set_key_value(*key, value);
476 static CYTHON_INLINE
void * PyThread_tss_get(Py_tss_t *key) {
477 return PyThread_get_key_value(*key);
480 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
481 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
483 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
485 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
486 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
487 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
489 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
490 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
492 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
493 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
495 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
497 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
498 #define CYTHON_PEP393_ENABLED 1
499 #if defined(PyUnicode_IS_READY)
500 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
501 0 : _PyUnicode_Ready((PyObject *)(op)))
503 #define __Pyx_PyUnicode_READY(op) (0)
505 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
506 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
507 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
508 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
509 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
510 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
511 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
512 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
513 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
514 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
516 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
519 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
522 #define CYTHON_PEP393_ENABLED 0
523 #define PyUnicode_1BYTE_KIND 1
524 #define PyUnicode_2BYTE_KIND 2
525 #define PyUnicode_4BYTE_KIND 4
526 #define __Pyx_PyUnicode_READY(op) (0)
527 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
528 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
529 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
530 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
531 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
532 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
533 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
534 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
536 #if CYTHON_COMPILING_IN_PYPY
537 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
538 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
540 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
541 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
542 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
544 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
545 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
547 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
548 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
550 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
551 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
553 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
554 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
555 #if PY_MAJOR_VERSION >= 3
556 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
558 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
560 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
561 #define PyObject_ASCII(o) PyObject_Repr(o)
563 #if PY_MAJOR_VERSION >= 3
564 #define PyBaseString_Type PyUnicode_Type
565 #define PyStringObject PyUnicodeObject
566 #define PyString_Type PyUnicode_Type
567 #define PyString_Check PyUnicode_Check
568 #define PyString_CheckExact PyUnicode_CheckExact
569 #ifndef PyObject_Unicode
570 #define PyObject_Unicode PyObject_Str
573 #if PY_MAJOR_VERSION >= 3
574 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
575 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
577 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
578 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
580 #ifndef PySet_CheckExact
581 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
583 #if PY_VERSION_HEX >= 0x030900A4
584 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
585 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
587 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
588 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
590 #if CYTHON_ASSUME_SAFE_MACROS
591 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
593 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
595 #if PY_MAJOR_VERSION >= 3
596 #define PyIntObject PyLongObject
597 #define PyInt_Type PyLong_Type
598 #define PyInt_Check(op) PyLong_Check(op)
599 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
600 #define PyInt_FromString PyLong_FromString
601 #define PyInt_FromUnicode PyLong_FromUnicode
602 #define PyInt_FromLong PyLong_FromLong
603 #define PyInt_FromSize_t PyLong_FromSize_t
604 #define PyInt_FromSsize_t PyLong_FromSsize_t
605 #define PyInt_AsLong PyLong_AsLong
606 #define PyInt_AS_LONG PyLong_AS_LONG
607 #define PyInt_AsSsize_t PyLong_AsSsize_t
608 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
609 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
610 #define PyNumber_Int PyNumber_Long
612 #if PY_MAJOR_VERSION >= 3
613 #define PyBoolObject PyLongObject
615 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
616 #ifndef PyUnicode_InternFromString
617 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
620 #if PY_VERSION_HEX < 0x030200A4
621 typedef long Py_hash_t;
622 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
623 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
625 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
626 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
628 #if PY_MAJOR_VERSION >= 3
629 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
631 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
633 #if CYTHON_USE_ASYNC_SLOTS
634 #if PY_VERSION_HEX >= 0x030500B1
635 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
636 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
638 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
641 #define __Pyx_PyType_AsAsync(obj) NULL
643 #ifndef __Pyx_PyAsyncMethodsStruct
648 } __Pyx_PyAsyncMethodsStruct;
651 #if defined(WIN32) || defined(MS_WINDOWS)
652 #define _USE_MATH_DEFINES
656 #define __PYX_NAN() ((float) NAN)
658 static CYTHON_INLINE
float __PYX_NAN() {
660 memset(&value, 0xFF,
sizeof(value));
664 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
665 #define __Pyx_truncl trunc
667 #define __Pyx_truncl truncl
670 #define __PYX_MARK_ERR_POS(f_index, lineno) \
671 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
672 #define __PYX_ERR(f_index, lineno, Ln_error) \
673 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
675 #ifndef __PYX_EXTERN_C
677 #define __PYX_EXTERN_C extern "C"
679 #define __PYX_EXTERN_C extern
683 #define __PYX_HAVE__imate___c_linear_operator__py_c_matrix
684 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_matrix
695 #include "pythread.h"
704 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
705 #define CYTHON_WITHOUT_ASSERTIONS
708 typedef struct {PyObject **p;
const char *s;
const Py_ssize_t n;
const char* encoding;
709 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
711 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
712 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
713 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
714 #define __PYX_DEFAULT_STRING_ENCODING ""
715 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
716 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
717 #define __Pyx_uchar_cast(c) ((unsigned char)c)
718 #define __Pyx_long_cast(x) ((long)x)
719 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
720 (sizeof(type) < sizeof(Py_ssize_t)) ||\
721 (sizeof(type) > sizeof(Py_ssize_t) &&\
722 likely(v < (type)PY_SSIZE_T_MAX ||\
723 v == (type)PY_SSIZE_T_MAX) &&\
724 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
725 v == (type)PY_SSIZE_T_MIN))) ||\
726 (sizeof(type) == sizeof(Py_ssize_t) &&\
727 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
728 v == (type)PY_SSIZE_T_MAX))) )
729 static CYTHON_INLINE
int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
730 return (
size_t) i < (size_t) limit;
732 #if defined (__cplusplus) && __cplusplus >= 201103L
734 #define __Pyx_sst_abs(value) std::abs(value)
735 #elif SIZEOF_INT >= SIZEOF_SIZE_T
736 #define __Pyx_sst_abs(value) abs(value)
737 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
738 #define __Pyx_sst_abs(value) labs(value)
739 #elif defined (_MSC_VER)
740 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
741 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
742 #define __Pyx_sst_abs(value) llabs(value)
743 #elif defined (__GNUC__)
744 #define __Pyx_sst_abs(value) __builtin_llabs(value)
746 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
748 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject*);
749 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
750 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
751 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
752 #define __Pyx_PyBytes_FromString PyBytes_FromString
753 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
754 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
755 #if PY_MAJOR_VERSION < 3
756 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
757 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
759 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
760 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
762 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
763 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
764 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
765 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
766 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
767 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
768 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
769 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
770 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
771 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
772 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
773 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
774 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
775 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
776 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
777 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
778 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u) {
779 const Py_UNICODE *u_end = u;
781 return (
size_t)(u_end - u - 1);
783 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
784 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
785 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
786 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
787 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
788 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b);
789 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
790 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
791 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
792 #define __Pyx_PySequence_Tuple(obj)\
793 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
794 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
795 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
796 #if CYTHON_ASSUME_SAFE_MACROS
797 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
799 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
801 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
802 #if PY_MAJOR_VERSION >= 3
803 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
805 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
807 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
808 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
809 static int __Pyx_sys_getdefaultencoding_not_ascii;
810 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
812 PyObject* default_encoding = NULL;
813 PyObject* ascii_chars_u = NULL;
814 PyObject* ascii_chars_b = NULL;
815 const char* default_encoding_c;
816 sys = PyImport_ImportModule(
"sys");
818 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
820 if (!default_encoding)
goto bad;
821 default_encoding_c = PyBytes_AsString(default_encoding);
822 if (!default_encoding_c)
goto bad;
823 if (strcmp(default_encoding_c,
"ascii") == 0) {
824 __Pyx_sys_getdefaultencoding_not_ascii = 0;
826 char ascii_chars[128];
828 for (c = 0; c < 128; c++) {
831 __Pyx_sys_getdefaultencoding_not_ascii = 1;
832 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
833 if (!ascii_chars_u)
goto bad;
834 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
835 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
838 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
842 Py_DECREF(ascii_chars_u);
843 Py_DECREF(ascii_chars_b);
845 Py_DECREF(default_encoding);
848 Py_XDECREF(default_encoding);
849 Py_XDECREF(ascii_chars_u);
850 Py_XDECREF(ascii_chars_b);
854 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
855 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
857 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
858 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
859 static char* __PYX_DEFAULT_STRING_ENCODING;
860 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
862 PyObject* default_encoding = NULL;
863 char* default_encoding_c;
864 sys = PyImport_ImportModule(
"sys");
866 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
868 if (!default_encoding)
goto bad;
869 default_encoding_c = PyBytes_AsString(default_encoding);
870 if (!default_encoding_c)
goto bad;
871 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c) + 1);
872 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
873 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
874 Py_DECREF(default_encoding);
877 Py_XDECREF(default_encoding);
885 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
886 #define likely(x) __builtin_expect(!!(x), 1)
887 #define unlikely(x) __builtin_expect(!!(x), 0)
889 #define likely(x) (x)
890 #define unlikely(x) (x)
892 static CYTHON_INLINE
void __Pyx_pretend_to_initialize(
void* ptr) { (void)ptr; }
894 static PyObject *__pyx_m = NULL;
895 static PyObject *__pyx_d;
896 static PyObject *__pyx_b;
897 static PyObject *__pyx_cython_runtime = NULL;
898 static PyObject *__pyx_empty_tuple;
899 static PyObject *__pyx_empty_bytes;
900 static PyObject *__pyx_empty_unicode;
901 static int __pyx_lineno;
902 static int __pyx_clineno = 0;
903 static const char * __pyx_cfilenm= __FILE__;
904 static const char *__pyx_filename;
907 static const char *__pyx_f[] = {
908 "imate/_c_linear_operator/py_c_matrix.pyx",
912 struct __pyx_memoryview_obj;
914 struct __pyx_memoryview_obj *memview;
917 Py_ssize_t strides[8];
918 Py_ssize_t suboffsets[8];
919 } __Pyx_memviewslice;
920 #define __Pyx_MemoryView_Len(m) (m.shape[0])
923 #include <pythread.h>
924 #ifndef CYTHON_ATOMICS
925 #define CYTHON_ATOMICS 1
927 #define __pyx_atomic_int_type int
928 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
929 (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
931 #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
932 #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
933 #ifdef __PYX_DEBUG_ATOMICS
934 #warning "Using GNU atomics"
936 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
938 #undef __pyx_atomic_int_type
939 #define __pyx_atomic_int_type LONG
940 #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
941 #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
942 #ifdef __PYX_DEBUG_ATOMICS
943 #pragma message ("Using MSVC atomics")
945 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
946 #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
947 #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
948 #ifdef __PYX_DEBUG_ATOMICS
949 #warning "Using Intel atomics"
952 #undef CYTHON_ATOMICS
953 #define CYTHON_ATOMICS 0
954 #ifdef __PYX_DEBUG_ATOMICS
955 #warning "Not using atomics"
958 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
960 #define __pyx_add_acquisition_count(memview)\
961 __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
962 #define __pyx_sub_acquisition_count(memview)\
963 __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
965 #define __pyx_add_acquisition_count(memview)\
966 __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
967 #define __pyx_sub_acquisition_count(memview)\
968 __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
972 #ifndef __PYX_FORCE_INIT_THREADS
973 #define __PYX_FORCE_INIT_THREADS 0
977 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
978 #define __Pyx_PyGILState_Release PyGILState_Release
979 #define __Pyx_FastGIL_Remember()
980 #define __Pyx_FastGIL_Forget()
981 #define __Pyx_FastGilFuncInit()
984 #define IS_UNSIGNED(type) (((type) -1) > 0)
985 struct __Pyx_StructField_;
986 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
989 struct __Pyx_StructField_* fields;
997 typedef struct __Pyx_StructField_ {
998 __Pyx_TypeInfo* type;
1001 } __Pyx_StructField;
1003 __Pyx_StructField* field;
1004 size_t parent_offset;
1005 } __Pyx_BufFmt_StackElem;
1007 __Pyx_StructField root;
1008 __Pyx_BufFmt_StackElem* head;
1010 size_t new_count, enc_count;
1011 size_t struct_alignment;
1016 char is_valid_array;
1017 } __Pyx_BufFmt_Context;
1027 typedef int __pyx_t_5imate_12_definitions_5types_LongIndexType;
1036 typedef int const __pyx_t_5imate_12_definitions_5types_ConstLongIndexType;
1045 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1054 typedef int const __pyx_t_5imate_12_definitions_5types_ConstIndexType;
1063 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1072 typedef int const __pyx_t_5imate_12_definitions_5types_ConstFlagType;
1075 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1076 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1077 struct __pyx_array_obj;
1078 struct __pyx_MemviewEnum_obj;
1079 struct __pyx_memoryview_obj;
1080 struct __pyx_memoryviewslice_obj;
1089 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1098 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1107 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1116 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(
double const ,
double const );
1125 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1127 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1131 char *data_type_name;
1132 char *long_index_type_name;
1133 __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1134 PyObject *parameters;
1145 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1146 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1148 PyObject *A_indices_copy;
1149 PyObject *A_index_pointer_copy;
1160 struct __pyx_array_obj {
1162 struct __pyx_vtabstruct_array *__pyx_vtab;
1168 Py_ssize_t *_strides;
1169 Py_ssize_t itemsize;
1172 void (*callback_free_data)(
void *);
1174 int dtype_is_object;
1185 struct __pyx_MemviewEnum_obj {
1198 struct __pyx_memoryview_obj {
1200 struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1203 PyObject *_array_interface;
1204 PyThread_type_lock lock;
1205 __pyx_atomic_int acquisition_count[2];
1206 __pyx_atomic_int *acquisition_count_aligned_p;
1209 int dtype_is_object;
1210 __Pyx_TypeInfo *typeinfo;
1221 struct __pyx_memoryviewslice_obj {
1222 struct __pyx_memoryview_obj __pyx_base;
1223 __Pyx_memviewslice from_slice;
1224 PyObject *from_object;
1225 PyObject *(*to_object_func)(
char *);
1226 int (*to_dtype_func)(
char *, PyObject *);
1239 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1240 __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_rows)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1241 __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_columns)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1242 cLinearOperator<float> *(*get_linear_operator_float)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1243 cLinearOperator<double> *(*get_linear_operator_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1244 cLinearOperator<long double> *(*get_linear_operator_long_double)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1245 void (*dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1246 void (*transpose_dot)(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *,
int __pyx_skip_dispatch);
1248 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1259 struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1260 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1262 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1273 struct __pyx_vtabstruct_array {
1274 PyObject *(*get_memview)(
struct __pyx_array_obj *);
1276 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1287 struct __pyx_vtabstruct_memoryview {
1288 char *(*get_item_pointer)(
struct __pyx_memoryview_obj *, PyObject *);
1289 PyObject *(*is_slice)(
struct __pyx_memoryview_obj *, PyObject *);
1290 PyObject *(*setitem_slice_assignment)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1291 PyObject *(*setitem_slice_assign_scalar)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *);
1292 PyObject *(*setitem_indexed)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1293 PyObject *(*convert_item_to_object)(
struct __pyx_memoryview_obj *,
char *);
1294 PyObject *(*assign_item_from_object)(
struct __pyx_memoryview_obj *,
char *, PyObject *);
1296 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1307 struct __pyx_vtabstruct__memoryviewslice {
1308 struct __pyx_vtabstruct_memoryview __pyx_base;
1310 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1314 #ifndef CYTHON_REFNANNY
1315 #define CYTHON_REFNANNY 0
1319 void (*INCREF)(
void*, PyObject*, int);
1320 void (*DECREF)(
void*, PyObject*, int);
1321 void (*GOTREF)(
void*, PyObject*, int);
1322 void (*GIVEREF)(
void*, PyObject*, int);
1323 void* (*SetupContext)(
const char*, int,
const char*);
1324 void (*FinishContext)(
void**);
1325 } __Pyx_RefNannyAPIStruct;
1326 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1327 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
1328 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1330 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1332 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1333 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1334 PyGILState_Release(__pyx_gilstate_save);\
1336 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1339 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1340 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1342 #define __Pyx_RefNannyFinishContext()\
1343 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1344 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1345 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1346 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1347 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1348 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1349 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1350 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1351 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1353 #define __Pyx_RefNannyDeclarations
1354 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1355 #define __Pyx_RefNannyFinishContext()
1356 #define __Pyx_INCREF(r) Py_INCREF(r)
1357 #define __Pyx_DECREF(r) Py_DECREF(r)
1358 #define __Pyx_GOTREF(r)
1359 #define __Pyx_GIVEREF(r)
1360 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1361 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1362 #define __Pyx_XGOTREF(r)
1363 #define __Pyx_XGIVEREF(r)
1365 #define __Pyx_XDECREF_SET(r, v) do {\
1366 PyObject *tmp = (PyObject *) r;\
1367 r = v; __Pyx_XDECREF(tmp);\
1369 #define __Pyx_DECREF_SET(r, v) do {\
1370 PyObject *tmp = (PyObject *) r;\
1371 r = v; __Pyx_DECREF(tmp);\
1373 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1374 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1377 #if CYTHON_USE_TYPE_SLOTS
1378 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1380 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1384 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1387 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
1390 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1391 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1392 const char* function_name);
1395 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
1396 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1399 #if CYTHON_FAST_THREAD_STATE
1400 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1401 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1402 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1404 #define __Pyx_PyThreadState_declare
1405 #define __Pyx_PyThreadState_assign
1406 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1410 #if CYTHON_FAST_THREAD_STATE
1411 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1412 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1413 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1414 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1415 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1416 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1417 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1418 #if CYTHON_COMPILING_IN_CPYTHON
1419 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1421 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1424 #define __Pyx_PyErr_Clear() PyErr_Clear()
1425 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1426 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1427 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1428 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1429 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1430 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1431 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1435 #ifndef CYTHON_PROFILE
1436 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1437 #define CYTHON_PROFILE 0
1439 #define CYTHON_PROFILE 1
1442 #ifndef CYTHON_TRACE_NOGIL
1443 #define CYTHON_TRACE_NOGIL 0
1445 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1446 #define CYTHON_TRACE 1
1449 #ifndef CYTHON_TRACE
1450 #define CYTHON_TRACE 0
1453 #undef CYTHON_PROFILE_REUSE_FRAME
1455 #ifndef CYTHON_PROFILE_REUSE_FRAME
1456 #define CYTHON_PROFILE_REUSE_FRAME 0
1458 #if CYTHON_PROFILE || CYTHON_TRACE
1459 #include "compile.h"
1460 #include "frameobject.h"
1461 #include "traceback.h"
1462 #if CYTHON_PROFILE_REUSE_FRAME
1463 #define CYTHON_FRAME_MODIFIER static
1464 #define CYTHON_FRAME_DEL(frame)
1466 #define CYTHON_FRAME_MODIFIER
1467 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1469 #define __Pyx_TraceDeclarations\
1470 static PyCodeObject *__pyx_frame_code = NULL;\
1471 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1472 int __Pyx_use_tracing = 0;
1473 #define __Pyx_TraceFrameInit(codeobj)\
1474 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1475 #if PY_VERSION_HEX >= 0x030a00b1
1476 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1477 (unlikely((tstate)->cframe->use_tracing) &&\
1478 (!(check_tracing) || !(tstate)->tracing) &&\
1479 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1480 #define __Pyx_SetTracing(tstate, enable)\
1481 (tstate)->cframe->use_tracing = (enable)
1483 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1484 (unlikely((tstate)->use_tracing) &&\
1485 (!(check_tracing) || !(tstate)->tracing) &&\
1486 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1487 #define __Pyx_SetTracing(tstate, enable)\
1488 (tstate)->use_tracing = (enable)
1491 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1493 if (CYTHON_TRACE_NOGIL) {\
1494 PyThreadState *tstate;\
1495 PyGILState_STATE state = PyGILState_Ensure();\
1496 tstate = __Pyx_PyThreadState_Current;\
1497 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1498 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1500 PyGILState_Release(state);\
1501 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1504 PyThreadState* tstate = PyThreadState_GET();\
1505 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1506 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1507 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1511 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1512 { PyThreadState* tstate = PyThreadState_GET();\
1513 if (__Pyx_IsTracing(tstate, 1, 1)) {\
1514 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1515 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1519 #define __Pyx_TraceException()\
1520 if (likely(!__Pyx_use_tracing)); else {\
1521 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1522 if (__Pyx_IsTracing(tstate, 0, 1)) {\
1524 __Pyx_SetTracing(tstate, 0);\
1525 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1527 if (CYTHON_TRACE && tstate->c_tracefunc)\
1528 tstate->c_tracefunc(\
1529 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1530 tstate->c_profilefunc(\
1531 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1532 Py_DECREF(exc_info);\
1534 __Pyx_SetTracing(tstate, 1);\
1538 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1539 PyObject *type, *value, *traceback;
1540 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1542 __Pyx_SetTracing(tstate, 0);
1543 if (CYTHON_TRACE && tstate->c_tracefunc)
1544 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1545 if (tstate->c_profilefunc)
1546 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1547 CYTHON_FRAME_DEL(frame);
1548 __Pyx_SetTracing(tstate, 1);
1550 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1553 #define __Pyx_TraceReturn(result, nogil)\
1554 if (likely(!__Pyx_use_tracing)); else {\
1556 if (CYTHON_TRACE_NOGIL) {\
1557 PyThreadState *tstate;\
1558 PyGILState_STATE state = PyGILState_Ensure();\
1559 tstate = __Pyx_PyThreadState_Current;\
1560 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1561 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1563 PyGILState_Release(state);\
1566 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1567 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1568 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1573 #define __Pyx_TraceReturn(result, nogil)\
1574 if (likely(!__Pyx_use_tracing)); else {\
1575 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1576 if (__Pyx_IsTracing(tstate, 0, 0)) {\
1577 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1581 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno);
1582 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate,
const char *funcname,
const char *srcfile,
int firstlineno);
1584 #define __Pyx_TraceDeclarations
1585 #define __Pyx_TraceFrameInit(codeobj)
1586 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1587 #define __Pyx_TraceException()
1588 #define __Pyx_TraceReturn(result, nogil)
1591 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame,
int lineno) {
1593 PyObject *type, *value, *traceback;
1594 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1595 __Pyx_PyFrame_SetLineNumber(frame, lineno);
1597 __Pyx_SetTracing(tstate, 0);
1598 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1599 __Pyx_SetTracing(tstate, 1);
1602 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1606 Py_XDECREF(traceback);
1611 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1612 if (likely(!__Pyx_use_tracing)); else {\
1614 if (CYTHON_TRACE_NOGIL) {\
1616 PyThreadState *tstate;\
1617 PyGILState_STATE state = PyGILState_Ensure();\
1618 tstate = __Pyx_PyThreadState_Current;\
1619 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1620 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1622 PyGILState_Release(state);\
1623 if (unlikely(ret)) goto_error;\
1626 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1627 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1628 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1629 if (unlikely(ret)) goto_error;\
1634 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1635 if (likely(!__Pyx_use_tracing)); else {\
1636 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1637 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1638 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1639 if (unlikely(ret)) goto_error;\
1644 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1648 #if CYTHON_COMPILING_IN_CPYTHON
1649 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1651 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1655 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1658 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2,
long intval,
long inplace);
1664 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals);
1667 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1668 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1669 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1670 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1671 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1672 (cache_var) = (value);
1673 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1674 static PY_UINT64_T __pyx_dict_version = 0;\
1675 static PyObject *__pyx_dict_cached_value = NULL;\
1676 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1677 (VAR) = __pyx_dict_cached_value;\
1679 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1680 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1683 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1684 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1685 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1687 #define __PYX_GET_DICT_VERSION(dict) (0)
1688 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1689 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1693 #if CYTHON_USE_DICT_VERSIONS
1694 #define __Pyx_GetModuleGlobalName(var, name) {\
1695 static PY_UINT64_T __pyx_dict_version = 0;\
1696 static PyObject *__pyx_dict_cached_value = NULL;\
1697 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1698 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1699 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1701 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1702 PY_UINT64_T __pyx_dict_version;\
1703 PyObject *__pyx_dict_cached_value;\
1704 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1706 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1708 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1709 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1710 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1714 #if CYTHON_FAST_PYCCALL
1715 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1717 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1721 #if CYTHON_FAST_PYCALL
1722 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1723 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1724 #if 1 || PY_VERSION_HEX < 0x030600B1
1725 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1727 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1729 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1730 (sizeof(char [1 - 2*!(cond)]) - 1)
1731 #ifndef Py_MEMBER_SIZE
1732 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1734 static size_t __pyx_pyframe_localsplus_offset = 0;
1735 #include "frameobject.h"
1736 #define __Pxy_PyFrame_Initialize_Offsets()\
1737 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1738 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1739 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1740 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1744 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2);
1747 #if CYTHON_COMPILING_IN_CPYTHON
1748 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1752 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1755 #if CYTHON_COMPILING_IN_CPYTHON
1756 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1758 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1762 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1763 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1764 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1765 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1766 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1767 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1768 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1769 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1770 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1771 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1772 int wraparound,
int boundscheck);
1773 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1774 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1775 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1776 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1777 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1778 int wraparound,
int boundscheck);
1779 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1780 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1781 int is_list,
int wraparound,
int boundscheck);
1784 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1785 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1786 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1787 (likely(PyDict_CheckExact(obj)) ?\
1788 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1790 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1791 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1795 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1796 #define __Pyx_MEMVIEW_DIRECT 1
1797 #define __Pyx_MEMVIEW_PTR 2
1798 #define __Pyx_MEMVIEW_FULL 4
1799 #define __Pyx_MEMVIEW_CONTIG 8
1800 #define __Pyx_MEMVIEW_STRIDED 16
1801 #define __Pyx_MEMVIEW_FOLLOW 32
1802 #define __Pyx_IS_C_CONTIG 1
1803 #define __Pyx_IS_F_CONTIG 2
1804 static int __Pyx_init_memviewslice(
1805 struct __pyx_memoryview_obj *memview,
1807 __Pyx_memviewslice *memviewslice,
1808 int memview_is_new_reference);
1809 static CYTHON_INLINE
int __pyx_add_acquisition_count_locked(
1810 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1811 static CYTHON_INLINE
int __pyx_sub_acquisition_count_locked(
1812 __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1813 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1814 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1815 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1816 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1817 static CYTHON_INLINE
void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1818 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *,
int,
int);
1821 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1822 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1823 __Pyx__ArgTypeTest(obj, type, name, exact))
1824 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact);
1827 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals);
1830 #if PY_MAJOR_VERSION >= 3
1831 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1833 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1837 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1838 (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1840 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1842 static void __Pyx_WriteUnraisable(
const char *name,
int clineno,
1843 int lineno,
const char *filename,
1844 int full_traceback,
int nogil);
1846 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *);
1848 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1851 #if CYTHON_USE_TYPE_SLOTS
1852 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1854 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1858 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(
const char *s, Py_ssize_t size,
const char *errors) {
1860 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1862 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(
const char *s, Py_ssize_t size,
const char *errors) {
1864 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1866 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(
const char *s, Py_ssize_t size,
const char *errors) {
1868 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1872 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1873 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1874 const char* encoding,
const char* errors,
1875 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors));
1878 #if CYTHON_FAST_THREAD_STATE
1879 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1880 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1882 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1886 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1889 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1892 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1895 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
1898 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1901 #if CYTHON_USE_EXC_INFO_STACK
1902 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1906 #if CYTHON_FAST_THREAD_STATE
1907 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1908 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1909 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1910 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1912 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1913 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1917 #if CYTHON_FAST_THREAD_STATE
1918 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1919 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1921 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1925 #if CYTHON_FAST_THREAD_STATE
1926 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1927 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1929 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1933 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
1936 #if CYTHON_COMPILING_IN_CPYTHON
1937 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1938 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1939 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1940 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1942 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1943 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1944 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1946 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1948 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1950 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1951 static CYTHON_INLINE
int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1952 PyListObject* L = (PyListObject*) list;
1953 Py_ssize_t len = Py_SIZE(list);
1954 if (likely(L->allocated > len)) {
1956 PyList_SET_ITEM(list, len, x);
1957 __Pyx_SET_SIZE(list, len + 1);
1960 return PyList_Append(list, x);
1963 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1967 #if !CYTHON_COMPILING_IN_PYPY
1968 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2,
long intval,
int inplace,
int zerodivision_check);
1970 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1971 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1975 static CYTHON_INLINE
int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1976 #if CYTHON_COMPILING_IN_CPYTHON
1977 PyObject* none = _PyList_Extend((PyListObject*)L, v);
1978 if (unlikely(!none))
1983 return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1988 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1989 static CYTHON_INLINE
int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1990 PyListObject* L = (PyListObject*) list;
1991 Py_ssize_t len = Py_SIZE(list);
1992 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1994 PyList_SET_ITEM(list, len, x);
1995 __Pyx_SET_SIZE(list, len + 1);
1998 return PyList_Append(list, x);
2001 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2005 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname);
2008 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2011 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *, PyObject *);
2014 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
2017 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v,
void *a, traverseproc current_tp_traverse);
2020 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2023 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2024 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2026 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2030 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2031 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2033 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2037 #ifndef __PYX_HAVE_RT_ImportType_proto
2038 #define __PYX_HAVE_RT_ImportType_proto
2039 enum __Pyx_ImportType_CheckSize {
2040 __Pyx_ImportType_CheckSize_Error = 0,
2041 __Pyx_ImportType_CheckSize_Warn = 1,
2042 __Pyx_ImportType_CheckSize_Ignore = 2
2044 static PyTypeObject *__Pyx_ImportType(PyObject* module,
const char *module_name,
const char *class_name,
size_t size,
enum __Pyx_ImportType_CheckSize check_size);
2048 static void* __Pyx_GetVtable(PyObject *dict);
2051 static int __Pyx_SetVtable(PyObject *dict,
void *vtable);
2054 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2057 static int __Pyx_setup_reduce(PyObject* type_obj);
2060 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2063 #define __Pyx_CyFunction_USED 1
2064 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2065 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2066 #define __Pyx_CYFUNCTION_CCLASS 0x04
2067 #define __Pyx_CyFunction_GetClosure(f)\
2068 (((__pyx_CyFunctionObject *) (f))->func_closure)
2069 #define __Pyx_CyFunction_GetClassObj(f)\
2070 (((__pyx_CyFunctionObject *) (f))->func_classobj)
2071 #define __Pyx_CyFunction_Defaults(type, f)\
2072 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2073 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2074 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2076 PyCFunctionObject func;
2077 #if PY_VERSION_HEX < 0x030500A0
2078 PyObject *func_weakreflist;
2080 PyObject *func_dict;
2081 PyObject *func_name;
2082 PyObject *func_qualname;
2084 PyObject *func_globals;
2085 PyObject *func_code;
2086 PyObject *func_closure;
2087 PyObject *func_classobj;
2089 int defaults_pyobjects;
2090 size_t defaults_size;
2092 PyObject *defaults_tuple;
2093 PyObject *defaults_kwdict;
2094 PyObject *(*defaults_getter)(PyObject *);
2095 PyObject *func_annotations;
2096 } __pyx_CyFunctionObject;
2097 static PyTypeObject *__pyx_CyFunctionType = 0;
2098 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2099 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2100 int flags, PyObject* qualname,
2102 PyObject *module, PyObject *globals,
2104 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2107 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2109 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2111 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2113 static int __pyx_CyFunction_init(
void);
2116 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2117 int flags, PyObject* qualname,
2119 PyObject *module, PyObject *globals,
2123 #ifdef CYTHON_CLINE_IN_TRACEBACK
2124 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2126 static int __Pyx_CLineForTraceback(PyThreadState *tstate,
int c_line);
2131 PyCodeObject* code_object;
2133 } __Pyx_CodeObjectCacheEntry;
2134 struct __Pyx_CodeObjectCache {
2137 __Pyx_CodeObjectCacheEntry* entries;
2139 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2140 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
2141 static PyCodeObject *__pyx_find_code_object(
int code_line);
2142 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
2145 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
2146 int py_line,
const char *filename);
2148 #if PY_MAJOR_VERSION < 3
2149 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
2150 static void __Pyx_ReleaseBuffer(Py_buffer *view);
2152 #define __Pyx_GetBuffer PyObject_GetBuffer
2153 #define __Pyx_ReleaseBuffer PyBuffer_Release
2159 Py_ssize_t shape, strides, suboffsets;
2160 } __Pyx_Buf_DimInfo;
2166 __Pyx_Buffer *rcbuffer;
2168 __Pyx_Buf_DimInfo diminfo[8];
2169 } __Pyx_LocalBuf_ND;
2172 static int __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim);
2175 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2176 __Pyx_memviewslice *slice2,
2177 int ndim,
size_t itemsize);
2180 static CYTHON_INLINE PyObject *__pyx_capsule_create(
void *p,
const char *sig);
2183 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2184 #define __Pyx_HAS_GCC_DIAGNOSTIC
2188 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void);
2191 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts);
2192 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2193 __Pyx_BufFmt_StackElem* stack,
2194 __Pyx_TypeInfo* type);
2197 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2200 static int __Pyx_ValidateAndInit_memviewslice(
2205 __Pyx_TypeInfo *dtype,
2206 __Pyx_BufFmt_StackElem stack[],
2207 __Pyx_memviewslice *memviewslice,
2208 PyObject *original_obj);
2211 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *,
int writable_flag);
2214 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *,
int writable_flag);
2217 #ifndef __Pyx_CppExn2PyErr
2220 #include <stdexcept>
2222 static void __Pyx_CppExn2PyErr() {
2224 if (PyErr_Occurred())
2228 }
catch (
const std::bad_alloc& exn) {
2229 PyErr_SetString(PyExc_MemoryError, exn.what());
2230 }
catch (
const std::bad_cast& exn) {
2231 PyErr_SetString(PyExc_TypeError, exn.what());
2232 }
catch (
const std::bad_typeid& exn) {
2233 PyErr_SetString(PyExc_TypeError, exn.what());
2234 }
catch (
const std::domain_error& exn) {
2235 PyErr_SetString(PyExc_ValueError, exn.what());
2236 }
catch (
const std::invalid_argument& exn) {
2237 PyErr_SetString(PyExc_ValueError, exn.what());
2238 }
catch (
const std::ios_base::failure& exn) {
2239 PyErr_SetString(PyExc_IOError, exn.what());
2240 }
catch (
const std::out_of_range& exn) {
2241 PyErr_SetString(PyExc_IndexError, exn.what());
2242 }
catch (
const std::overflow_error& exn) {
2243 PyErr_SetString(PyExc_OverflowError, exn.what());
2244 }
catch (
const std::range_error& exn) {
2245 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2246 }
catch (
const std::underflow_error& exn) {
2247 PyErr_SetString(PyExc_ArithmeticError, exn.what());
2248 }
catch (
const std::exception& exn) {
2249 PyErr_SetString(PyExc_RuntimeError, exn.what());
2253 PyErr_SetString(PyExc_RuntimeError,
"Unknown exception");
2259 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *,
int writable_flag);
2262 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *,
int writable_flag);
2265 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *,
int writable_flag);
2268 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *,
int writable_flag);
2271 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *,
int writable_flag);
2274 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *,
int writable_flag);
2277 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *,
int writable_flag);
2280 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *,
int writable_flag);
2283 static __Pyx_memviewslice
2284 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
2285 const char *mode,
int ndim,
2286 size_t sizeof_dtype,
int contig_flag,
2287 int dtype_is_object);
2290 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
2293 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
2296 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
2299 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
2302 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *);
2305 static int __Pyx_check_binary_version(
void);
2308 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2310 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self);
2311 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2312 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj);
2313 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src);
2314 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value);
2315 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2316 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp);
2317 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2318 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp);
2319 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value);
2326 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2337 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = 0;
2338 static PyTypeObject *__pyx_array_type = 0;
2339 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2340 static PyTypeObject *__pyx_memoryview_type = 0;
2341 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2342 static PyObject *
generic = 0;
2343 static PyObject *strided = 0;
2344 static PyObject *indirect = 0;
2345 static PyObject *contiguous = 0;
2346 static PyObject *indirect_contiguous = 0;
2347 static int __pyx_memoryview_thread_locks_used;
2348 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2349 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t,
char *,
char *,
char *);
2350 static void *__pyx_align_pointer(
void *,
size_t);
2351 static PyObject *__pyx_memoryview_new(PyObject *,
int,
int, __Pyx_TypeInfo *);
2352 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *);
2353 static PyObject *_unellipsify(PyObject *,
int);
2354 static PyObject *assert_direct_dimensions(Py_ssize_t *,
int);
2355 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *, PyObject *);
2356 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int *, Py_ssize_t, Py_ssize_t, Py_ssize_t,
int,
int,
int,
int);
2357 static char *__pyx_pybuffer_index(Py_buffer *,
char *, Py_ssize_t, Py_ssize_t);
2358 static int __pyx_memslice_transpose(__Pyx_memviewslice *);
2359 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice,
int, PyObject *(*)(
char *),
int (*)(
char *, PyObject *),
int);
2360 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2361 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2362 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *);
2363 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *, __Pyx_memviewslice *);
2364 static Py_ssize_t abs_py_ssize_t(Py_ssize_t);
2365 static char __pyx_get_best_slice_order(__Pyx_memviewslice *,
int);
2366 static void _copy_strided_to_strided(
char *, Py_ssize_t *,
char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *,
int,
size_t);
2367 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *,
int,
size_t);
2368 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *,
int);
2369 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t,
int,
char);
2370 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *,
char,
int);
2371 static int __pyx_memoryview_err_extents(
int, Py_ssize_t, Py_ssize_t);
2372 static int __pyx_memoryview_err_dim(PyObject *,
char *,
int);
2373 static int __pyx_memoryview_err(PyObject *,
char *);
2374 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice,
int,
int,
int);
2375 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *,
int,
int);
2376 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *,
int,
int,
int);
2377 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2378 static void __pyx_memoryview_refcount_objects_in_slice(
char *, Py_ssize_t *, Py_ssize_t *,
int,
int);
2379 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *,
int,
size_t,
void *,
int);
2380 static void __pyx_memoryview__slice_assign_scalar(
char *, Py_ssize_t *, Py_ssize_t *,
int,
size_t,
void *);
2381 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *, PyObject *);
2382 static __Pyx_TypeInfo __Pyx_TypeInfo_float = {
"float", NULL,
sizeof(float), { 0 }, 0,
'R', 0, 0 };
2383 static __Pyx_TypeInfo __Pyx_TypeInfo_double = {
"double", NULL,
sizeof(double), { 0 }, 0,
'R', 0, 0 };
2384 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = {
"long double", NULL,
sizeof(
long double), { 0 }, 0,
'R', 0, 0 };
2385 static __Pyx_TypeInfo __Pyx_TypeInfo_int = {
"int", NULL,
sizeof(int), { 0 }, 0, IS_UNSIGNED(
int) ?
'U' :
'I', IS_UNSIGNED(
int), 0 };
2386 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_matrix"
2387 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix;
2388 int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix = 0;
2391 static PyObject *__pyx_builtin_ValueError;
2392 static PyObject *__pyx_builtin_TypeError;
2393 static PyObject *__pyx_builtin_MemoryError;
2394 static PyObject *__pyx_builtin_enumerate;
2395 static PyObject *__pyx_builtin_range;
2396 static PyObject *__pyx_builtin_Ellipsis;
2397 static PyObject *__pyx_builtin_id;
2398 static PyObject *__pyx_builtin_IndexError;
2399 static const char __pyx_k_A[] =
"A";
2400 static const char __pyx_k_O[] =
"O";
2401 static const char __pyx_k_c[] =
"c";
2402 static const char __pyx_k_id[] =
"id";
2403 static const char __pyx_k_new[] =
"__new__";
2404 static const char __pyx_k_obj[] =
"obj";
2405 static const char __pyx_k_base[] =
"base";
2406 static const char __pyx_k_copy[] =
"copy";
2407 static const char __pyx_k_data[] =
"data";
2408 static const char __pyx_k_dict[] =
"__dict__";
2409 static const char __pyx_k_main[] =
"__main__";
2410 static const char __pyx_k_mode[] =
"mode";
2411 static const char __pyx_k_name[] =
"name";
2412 static const char __pyx_k_ndim[] =
"ndim";
2413 static const char __pyx_k_pack[] =
"pack";
2414 static const char __pyx_k_self[] =
"self";
2415 static const char __pyx_k_size[] =
"size";
2416 static const char __pyx_k_step[] =
"step";
2417 static const char __pyx_k_stop[] =
"stop";
2418 static const char __pyx_k_test[] =
"__test__";
2419 static const char __pyx_k_ASCII[] =
"ASCII";
2420 static const char __pyx_k_class[] =
"__class__";
2421 static const char __pyx_k_dtype[] =
"dtype";
2422 static const char __pyx_k_error[] =
"error";
2423 static const char __pyx_k_flags[] =
"flags";
2424 static const char __pyx_k_numpy[] =
"numpy";
2425 static const char __pyx_k_range[] =
"range";
2426 static const char __pyx_k_shape[] =
"shape";
2427 static const char __pyx_k_start[] =
"start";
2428 static const char __pyx_k_astype[] =
"astype";
2429 static const char __pyx_k_encode[] =
"encode";
2430 static const char __pyx_k_format[] =
"format";
2431 static const char __pyx_k_import[] =
"__import__";
2432 static const char __pyx_k_indptr[] =
"indptr";
2433 static const char __pyx_k_name_2[] =
"__name__";
2434 static const char __pyx_k_pickle[] =
"pickle";
2435 static const char __pyx_k_reduce[] =
"__reduce__";
2436 static const char __pyx_k_struct[] =
"struct";
2437 static const char __pyx_k_unpack[] =
"unpack";
2438 static const char __pyx_k_update[] =
"update";
2439 static const char __pyx_k_float32[] =
"float32";
2440 static const char __pyx_k_float64[] =
"float64";
2441 static const char __pyx_k_fortran[] =
"fortran";
2442 static const char __pyx_k_indices[] =
"indices";
2443 static const char __pyx_k_memview[] =
"memview";
2444 static const char __pyx_k_Ellipsis[] =
"Ellipsis";
2445 static const char __pyx_k_float128[] =
"float128";
2446 static const char __pyx_k_getstate[] =
"__getstate__";
2447 static const char __pyx_k_issparse[] =
"issparse";
2448 static const char __pyx_k_itemsize[] =
"itemsize";
2449 static const char __pyx_k_pyx_type[] =
"__pyx_type";
2450 static const char __pyx_k_setstate[] =
"__setstate__";
2451 static const char __pyx_k_A_indices[] =
"A_indices";
2452 static const char __pyx_k_TypeError[] =
"TypeError";
2453 static const char __pyx_k_enumerate[] =
"enumerate";
2454 static const char __pyx_k_pycMatrix[] =
"pycMatrix";
2455 static const char __pyx_k_pyx_state[] =
"__pyx_state";
2456 static const char __pyx_k_reduce_ex[] =
"__reduce_ex__";
2457 static const char __pyx_k_A_num_rows[] =
"A_num_rows";
2458 static const char __pyx_k_IndexError[] =
"IndexError";
2459 static const char __pyx_k_ValueError[] =
"ValueError";
2460 static const char __pyx_k_csr_matrix[] =
"csr_matrix";
2461 static const char __pyx_k_pyx_result[] =
"__pyx_result";
2462 static const char __pyx_k_pyx_vtable[] =
"__pyx_vtable__";
2463 static const char __pyx_k_MemoryError[] =
"MemoryError";
2464 static const char __pyx_k_PickleError[] =
"PickleError";
2465 static const char __pyx_k_A_data_float[] =
"A_data_float";
2466 static const char __pyx_k_A_indices_mv[] =
"A_indices_mv";
2467 static const char __pyx_k_C_CONTIGUOUS[] =
"C_CONTIGUOUS";
2468 static const char __pyx_k_F_CONTIGUOUS[] =
"F_CONTIGUOUS";
2469 static const char __pyx_k_pyx_checksum[] =
"__pyx_checksum";
2470 static const char __pyx_k_scipy_sparse[] =
"scipy.sparse";
2471 static const char __pyx_k_sort_indices[] =
"sort_indices";
2472 static const char __pyx_k_stringsource[] =
"stringsource";
2473 static const char __pyx_k_A_data_double[] =
"A_data_double";
2474 static const char __pyx_k_A_num_columns[] =
"A_num_columns";
2475 static const char __pyx_k_pyx_getbuffer[] =
"__pyx_getbuffer";
2476 static const char __pyx_k_reduce_cython[] =
"__reduce_cython__";
2477 static const char __pyx_k_A_is_row_major[] =
"A_is_row_major";
2478 static const char __pyx_k_isspmatrix_csc[] =
"isspmatrix_csc";
2479 static const char __pyx_k_isspmatrix_csr[] =
"isspmatrix_csr";
2480 static const char __pyx_k_A_data_float_mv[] =
"A_data_float_mv";
2481 static const char __pyx_k_A_index_pointer[] =
"A_index_pointer";
2482 static const char __pyx_k_View_MemoryView[] =
"View.MemoryView";
2483 static const char __pyx_k_allocate_buffer[] =
"allocate_buffer";
2484 static const char __pyx_k_dtype_is_object[] =
"dtype_is_object";
2485 static const char __pyx_k_pyx_PickleError[] =
"__pyx_PickleError";
2486 static const char __pyx_k_setstate_cython[] =
"__setstate_cython__";
2487 static const char __pyx_k_A_cannot_be_None[] =
"A cannot be None.";
2488 static const char __pyx_k_A_data_double_mv[] =
"A_data_double_mv";
2489 static const char __pyx_k_A_data_float_mv_c[] =
"A_data_float_mv_c";
2490 static const char __pyx_k_A_data_float_mv_f[] =
"A_data_float_mv_f";
2491 static const char __pyx_k_pyx_unpickle_Enum[] =
"__pyx_unpickle_Enum";
2492 static const char __pyx_k_A_data_double_mv_c[] =
"A_data_double_mv_c";
2493 static const char __pyx_k_A_data_double_mv_f[] =
"A_data_double_mv_f";
2494 static const char __pyx_k_A_data_long_double[] =
"A_data_long_double";
2495 static const char __pyx_k_A_index_pointer_mv[] =
"A_index_pointer_mv";
2496 static const char __pyx_k_cline_in_traceback[] =
"cline_in_traceback";
2497 static const char __pyx_k_has_sorted_indices[] =
"has_sorted_indices";
2498 static const char __pyx_k_strided_and_direct[] =
"<strided and direct>";
2499 static const char __pyx_k_set_csc_matrix_float[] =
"set_csc_matrix_float";
2500 static const char __pyx_k_set_csr_matrix_float[] =
"set_csr_matrix_float";
2501 static const char __pyx_k_strided_and_indirect[] =
"<strided and indirect>";
2502 static const char __pyx_k_A_data_long_double_mv[] =
"A_data_long_double_mv";
2503 static const char __pyx_k_contiguous_and_direct[] =
"<contiguous and direct>";
2504 static const char __pyx_k_set_csc_matrix_double[] =
"set_csc_matrix_double";
2505 static const char __pyx_k_set_csr_matrix_double[] =
"set_csr_matrix_double";
2506 static const char __pyx_k_MemoryView_of_r_object[] =
"<MemoryView of %r object>";
2507 static const char __pyx_k_set_dense_matrix_float[] =
"set_dense_matrix_float";
2508 static const char __pyx_k_A_data_long_double_mv_c[] =
"A_data_long_double_mv_c";
2509 static const char __pyx_k_A_data_long_double_mv_f[] =
"A_data_long_double_mv_f";
2510 static const char __pyx_k_MemoryView_of_r_at_0x_x[] =
"<MemoryView of %r at 0x%x>";
2511 static const char __pyx_k_contiguous_and_indirect[] =
"<contiguous and indirect>";
2512 static const char __pyx_k_set_dense_matrix_double[] =
"set_dense_matrix_double";
2513 static const char __pyx_k_Cannot_index_with_type_s[] =
"Cannot index with type '%s'";
2514 static const char __pyx_k_Invalid_shape_in_axis_d_d[] =
"Invalid shape in axis %d: %d.";
2515 static const char __pyx_k_pycMatrix___reduce_cython[] =
"pycMatrix.__reduce_cython__";
2516 static const char __pyx_k_set_csc_matrix_long_double[] =
"set_csc_matrix_long_double";
2517 static const char __pyx_k_set_csr_matrix_long_double[] =
"set_csr_matrix_long_double";
2518 static const char __pyx_k_itemsize_0_for_cython_array[] =
"itemsize <= 0 for cython.array";
2519 static const char __pyx_k_pycMatrix___setstate_cython[] =
"pycMatrix.__setstate_cython__";
2520 static const char __pyx_k_set_dense_matrix_long_double[] =
"set_dense_matrix_long_double";
2521 static const char __pyx_k_unable_to_allocate_array_data[] =
"unable to allocate array data.";
2522 static const char __pyx_k_pycMatrix_set_csc_matrix_float[] =
"pycMatrix.set_csc_matrix_float";
2523 static const char __pyx_k_pycMatrix_set_csr_matrix_float[] =
"pycMatrix.set_csr_matrix_float";
2524 static const char __pyx_k_strided_and_direct_or_indirect[] =
"<strided and direct or indirect>";
2525 static const char __pyx_k_pycMatrix_set_csc_matrix_double[] =
"pycMatrix.set_csc_matrix_double";
2526 static const char __pyx_k_pycMatrix_set_csr_matrix_double[] =
"pycMatrix.set_csr_matrix_double";
2527 static const char __pyx_k_pycMatrix_set_dense_matrix_long[] =
"pycMatrix.set_dense_matrix_long_double";
2528 static const char __pyx_k_Buffer_view_does_not_expose_stri[] =
"Buffer view does not expose strides";
2529 static const char __pyx_k_Can_only_create_a_buffer_that_is[] =
"Can only create a buffer that is contiguous in memory.";
2530 static const char __pyx_k_Cannot_assign_to_read_only_memor[] =
"Cannot assign to read-only memoryview";
2531 static const char __pyx_k_Cannot_create_writable_memory_vi[] =
"Cannot create writable memory view from read-only memoryview";
2532 static const char __pyx_k_Data_type_should_be_float32_floa[] =
"Data type should be \"float32\", \"float64\", or \"float128\".";
2533 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] =
"Empty shape tuple for cython.array";
2534 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] =
"Incompatible checksums (%s vs 0xb068931 = (name))";
2535 static const char __pyx_k_Indirect_dimensions_not_supporte[] =
"Indirect dimensions not supported";
2536 static const char __pyx_k_Input_matrix_should_be_a_2_dimen[] =
"Input matrix should be a 2-dimensional array.";
2537 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] =
"Invalid mode, expected 'c' or 'fortran', got %s";
2538 static const char __pyx_k_Matrix_A_should_be_either_C_or_F[] =
"Matrix A should be either C or F contiguous.";
2539 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] =
"Out of bounds on buffer access (axis %d)";
2540 static const char __pyx_k_Unable_to_convert_item_to_object[] =
"Unable to convert item to object";
2541 static const char __pyx_k_got_differing_extents_in_dimensi[] =
"got differing extents in dimension %d (got %d and %d)";
2542 static const char __pyx_k_imate__c_linear_operator_py_c_ma[] =
"imate/_c_linear_operator/py_c_matrix.pyx";
2543 static const char __pyx_k_no_default___reduce___due_to_non[] =
"no default __reduce__ due to non-trivial __cinit__";
2544 static const char __pyx_k_pycMatrix_set_csc_matrix_long_do[] =
"pycMatrix.set_csc_matrix_long_double";
2545 static const char __pyx_k_pycMatrix_set_csr_matrix_long_do[] =
"pycMatrix.set_csr_matrix_long_double";
2546 static const char __pyx_k_pycMatrix_set_dense_matrix_doubl[] =
"pycMatrix.set_dense_matrix_double";
2547 static const char __pyx_k_pycMatrix_set_dense_matrix_float[] =
"pycMatrix.set_dense_matrix_float";
2548 static const char __pyx_k_unable_to_allocate_shape_and_str[] =
"unable to allocate shape and strides.";
2549 static const char __pyx_k_imate__c_linear_operator_py_c_ma_2[] =
"imate._c_linear_operator.py_c_matrix";
2550 static PyObject *__pyx_n_s_A;
2551 static PyObject *__pyx_n_s_ASCII;
2552 static PyObject *__pyx_kp_u_A_cannot_be_None;
2553 static PyObject *__pyx_n_s_A_data_double;
2554 static PyObject *__pyx_n_s_A_data_double_mv;
2555 static PyObject *__pyx_n_s_A_data_double_mv_c;
2556 static PyObject *__pyx_n_s_A_data_double_mv_f;
2557 static PyObject *__pyx_n_s_A_data_float;
2558 static PyObject *__pyx_n_s_A_data_float_mv;
2559 static PyObject *__pyx_n_s_A_data_float_mv_c;
2560 static PyObject *__pyx_n_s_A_data_float_mv_f;
2561 static PyObject *__pyx_n_s_A_data_long_double;
2562 static PyObject *__pyx_n_s_A_data_long_double_mv;
2563 static PyObject *__pyx_n_s_A_data_long_double_mv_c;
2564 static PyObject *__pyx_n_s_A_data_long_double_mv_f;
2565 static PyObject *__pyx_n_s_A_index_pointer;
2566 static PyObject *__pyx_n_s_A_index_pointer_mv;
2567 static PyObject *__pyx_n_s_A_indices;
2568 static PyObject *__pyx_n_s_A_indices_mv;
2569 static PyObject *__pyx_n_s_A_is_row_major;
2570 static PyObject *__pyx_n_s_A_num_columns;
2571 static PyObject *__pyx_n_s_A_num_rows;
2572 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2573 static PyObject *__pyx_n_u_C_CONTIGUOUS;
2574 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2575 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2576 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2577 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2578 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
2579 static PyObject *__pyx_n_s_Ellipsis;
2580 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2581 static PyObject *__pyx_n_u_F_CONTIGUOUS;
2582 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2583 static PyObject *__pyx_n_s_IndexError;
2584 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2585 static PyObject *__pyx_kp_u_Input_matrix_should_be_a_2_dimen;
2586 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2587 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2588 static PyObject *__pyx_kp_u_Matrix_A_should_be_either_C_or_F;
2589 static PyObject *__pyx_n_s_MemoryError;
2590 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2591 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2592 static PyObject *__pyx_n_b_O;
2593 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2594 static PyObject *__pyx_n_s_PickleError;
2595 static PyObject *__pyx_n_s_TypeError;
2596 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2597 static PyObject *__pyx_n_s_ValueError;
2598 static PyObject *__pyx_n_s_View_MemoryView;
2599 static PyObject *__pyx_n_s_allocate_buffer;
2600 static PyObject *__pyx_n_s_astype;
2601 static PyObject *__pyx_n_s_base;
2602 static PyObject *__pyx_n_s_c;
2603 static PyObject *__pyx_n_u_c;
2604 static PyObject *__pyx_n_s_class;
2605 static PyObject *__pyx_n_s_cline_in_traceback;
2606 static PyObject *__pyx_kp_s_contiguous_and_direct;
2607 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2608 static PyObject *__pyx_n_s_copy;
2609 static PyObject *__pyx_n_s_csr_matrix;
2610 static PyObject *__pyx_n_s_data;
2611 static PyObject *__pyx_n_s_dict;
2612 static PyObject *__pyx_n_s_dtype;
2613 static PyObject *__pyx_n_s_dtype_is_object;
2614 static PyObject *__pyx_n_s_encode;
2615 static PyObject *__pyx_n_s_enumerate;
2616 static PyObject *__pyx_n_s_error;
2617 static PyObject *__pyx_n_s_flags;
2618 static PyObject *__pyx_n_b_float128;
2619 static PyObject *__pyx_n_b_float32;
2620 static PyObject *__pyx_n_b_float64;
2621 static PyObject *__pyx_n_s_format;
2622 static PyObject *__pyx_n_s_fortran;
2623 static PyObject *__pyx_n_u_fortran;
2624 static PyObject *__pyx_n_s_getstate;
2625 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2626 static PyObject *__pyx_n_s_has_sorted_indices;
2627 static PyObject *__pyx_n_s_id;
2628 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_ma;
2629 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_ma_2;
2630 static PyObject *__pyx_n_s_import;
2631 static PyObject *__pyx_n_s_indices;
2632 static PyObject *__pyx_n_s_indptr;
2633 static PyObject *__pyx_n_s_issparse;
2634 static PyObject *__pyx_n_s_isspmatrix_csc;
2635 static PyObject *__pyx_n_s_isspmatrix_csr;
2636 static PyObject *__pyx_n_s_itemsize;
2637 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2638 static PyObject *__pyx_n_s_main;
2639 static PyObject *__pyx_n_s_memview;
2640 static PyObject *__pyx_n_s_mode;
2641 static PyObject *__pyx_n_s_name;
2642 static PyObject *__pyx_n_s_name_2;
2643 static PyObject *__pyx_n_s_ndim;
2644 static PyObject *__pyx_n_s_new;
2645 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2646 static PyObject *__pyx_n_s_numpy;
2647 static PyObject *__pyx_n_s_obj;
2648 static PyObject *__pyx_n_s_pack;
2649 static PyObject *__pyx_n_s_pickle;
2650 static PyObject *__pyx_n_s_pycMatrix;
2651 static PyObject *__pyx_n_s_pycMatrix___reduce_cython;
2652 static PyObject *__pyx_n_s_pycMatrix___setstate_cython;
2653 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_double;
2654 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_float;
2655 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_long_do;
2656 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_double;
2657 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_float;
2658 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_long_do;
2659 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_doubl;
2660 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_float;
2661 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_long;
2662 static PyObject *__pyx_n_s_pyx_PickleError;
2663 static PyObject *__pyx_n_s_pyx_checksum;
2664 static PyObject *__pyx_n_s_pyx_getbuffer;
2665 static PyObject *__pyx_n_s_pyx_result;
2666 static PyObject *__pyx_n_s_pyx_state;
2667 static PyObject *__pyx_n_s_pyx_type;
2668 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2669 static PyObject *__pyx_n_s_pyx_vtable;
2670 static PyObject *__pyx_n_s_range;
2671 static PyObject *__pyx_n_s_reduce;
2672 static PyObject *__pyx_n_s_reduce_cython;
2673 static PyObject *__pyx_n_s_reduce_ex;
2674 static PyObject *__pyx_n_s_scipy_sparse;
2675 static PyObject *__pyx_n_s_self;
2676 static PyObject *__pyx_n_s_set_csc_matrix_double;
2677 static PyObject *__pyx_n_s_set_csc_matrix_float;
2678 static PyObject *__pyx_n_s_set_csc_matrix_long_double;
2679 static PyObject *__pyx_n_s_set_csr_matrix_double;
2680 static PyObject *__pyx_n_s_set_csr_matrix_float;
2681 static PyObject *__pyx_n_s_set_csr_matrix_long_double;
2682 static PyObject *__pyx_n_s_set_dense_matrix_double;
2683 static PyObject *__pyx_n_s_set_dense_matrix_float;
2684 static PyObject *__pyx_n_s_set_dense_matrix_long_double;
2685 static PyObject *__pyx_n_s_setstate;
2686 static PyObject *__pyx_n_s_setstate_cython;
2687 static PyObject *__pyx_n_s_shape;
2688 static PyObject *__pyx_n_s_size;
2689 static PyObject *__pyx_n_s_sort_indices;
2690 static PyObject *__pyx_n_s_start;
2691 static PyObject *__pyx_n_s_step;
2692 static PyObject *__pyx_n_s_stop;
2693 static PyObject *__pyx_kp_s_strided_and_direct;
2694 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2695 static PyObject *__pyx_kp_s_strided_and_indirect;
2696 static PyObject *__pyx_kp_s_stringsource;
2697 static PyObject *__pyx_n_s_struct;
2698 static PyObject *__pyx_n_s_test;
2699 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2700 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2701 static PyObject *__pyx_n_s_unpack;
2702 static PyObject *__pyx_n_s_update;
2703 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2704 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2705 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2706 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2707 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2708 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2709 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2710 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2711 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2712 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A);
2713 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self);
2714 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2715 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer);
2716 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2717 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self);
2718 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self);
2719 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self);
2720 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr);
2721 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item);
2722 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
2723 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self);
2724 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2725 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name);
2726 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2727 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self);
2728 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state);
2729 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object);
2730 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self);
2731 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index);
2732 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
2733 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
2734 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2735 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2736 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2737 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2738 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2739 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2740 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2741 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2742 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self);
2743 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self);
2744 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self);
2745 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self);
2746 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2747 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self);
2748 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self);
2749 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self);
2750 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self);
2751 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2752 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2753 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2754 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self);
2755 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state);
2756 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state);
2757 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k);
2758 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k);
2759 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k);
2760 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k);
2761 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k);
2762 static PyObject *__pyx_int_0;
2763 static PyObject *__pyx_int_1;
2764 static PyObject *__pyx_int_2;
2765 static PyObject *__pyx_int_184977713;
2766 static PyObject *__pyx_int_neg_1;
2767 static PyObject *__pyx_tuple_;
2768 static PyObject *__pyx_tuple__2;
2769 static PyObject *__pyx_tuple__3;
2770 static PyObject *__pyx_tuple__5;
2771 static PyObject *__pyx_slice__32;
2772 static PyObject *__pyx_tuple__15;
2773 static PyObject *__pyx_tuple__17;
2774 static PyObject *__pyx_tuple__18;
2775 static PyObject *__pyx_tuple__19;
2776 static PyObject *__pyx_tuple__20;
2777 static PyObject *__pyx_tuple__21;
2778 static PyObject *__pyx_tuple__22;
2779 static PyObject *__pyx_tuple__23;
2780 static PyObject *__pyx_tuple__24;
2781 static PyObject *__pyx_tuple__25;
2782 static PyObject *__pyx_tuple__26;
2783 static PyObject *__pyx_tuple__27;
2784 static PyObject *__pyx_tuple__28;
2785 static PyObject *__pyx_tuple__29;
2786 static PyObject *__pyx_tuple__30;
2787 static PyObject *__pyx_tuple__31;
2788 static PyObject *__pyx_tuple__33;
2789 static PyObject *__pyx_tuple__34;
2790 static PyObject *__pyx_tuple__35;
2791 static PyObject *__pyx_tuple__37;
2792 static PyObject *__pyx_tuple__38;
2793 static PyObject *__pyx_tuple__39;
2794 static PyObject *__pyx_tuple__40;
2795 static PyObject *__pyx_tuple__41;
2796 static PyObject *__pyx_tuple__42;
2797 static PyObject *__pyx_tuple__43;
2798 static PyObject *__pyx_tuple__44;
2799 static PyObject *__pyx_tuple__45;
2800 static PyObject *__pyx_tuple__46;
2801 static PyObject *__pyx_tuple__47;
2802 static PyObject *__pyx_tuple__48;
2803 static PyObject *__pyx_tuple__49;
2804 static PyObject *__pyx_tuple__50;
2805 static PyObject *__pyx_tuple__51;
2806 static PyObject *__pyx_tuple__52;
2807 static PyObject *__pyx_tuple__53;
2808 static PyObject *__pyx_codeobj__4;
2809 static PyObject *__pyx_codeobj__6;
2810 static PyObject *__pyx_codeobj__7;
2811 static PyObject *__pyx_codeobj__8;
2812 static PyObject *__pyx_codeobj__9;
2813 static PyObject *__pyx_codeobj__10;
2814 static PyObject *__pyx_codeobj__11;
2815 static PyObject *__pyx_codeobj__12;
2816 static PyObject *__pyx_codeobj__13;
2817 static PyObject *__pyx_codeobj__14;
2818 static PyObject *__pyx_codeobj__16;
2819 static PyObject *__pyx_codeobj__36;
2831 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2832 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2833 PyObject *__pyx_v_A = 0;
2834 int __pyx_lineno = 0;
2835 const char *__pyx_filename = NULL;
2836 int __pyx_clineno = 0;
2838 __Pyx_RefNannyDeclarations
2839 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
2841 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,0};
2842 PyObject* values[1] = {0};
2843 if (unlikely(__pyx_kwds)) {
2845 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2847 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2850 default:
goto __pyx_L5_argtuple_error;
2852 kw_args = PyDict_Size(__pyx_kwds);
2855 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
2856 else goto __pyx_L5_argtuple_error;
2858 if (unlikely(kw_args > 0)) {
2859 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
2861 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2862 goto __pyx_L5_argtuple_error;
2864 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2866 __pyx_v_A = values[0];
2868 goto __pyx_L4_argument_unpacking_done;
2869 __pyx_L5_argtuple_error:;
2870 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
2872 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2873 __Pyx_RefNannyFinishContext();
2875 __pyx_L4_argument_unpacking_done:;
2876 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), __pyx_v_A);
2879 __Pyx_RefNannyFinishContext();
2883 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
2885 __Pyx_TraceDeclarations
2886 __Pyx_RefNannyDeclarations
2889 PyObject *__pyx_t_3 = NULL;
2890 PyObject *__pyx_t_4 = NULL;
2891 PyObject *__pyx_t_5 = NULL;
2892 int __pyx_lineno = 0;
2893 const char *__pyx_filename = NULL;
2894 int __pyx_clineno = 0;
2895 __Pyx_RefNannySetupContext(
"__cinit__", 0);
2896 __Pyx_TraceCall(
"__cinit__", __pyx_f[0], 119, 0, __PYX_ERR(0, 119, __pyx_L1_error));
2905 __Pyx_TraceLine(125,0,__PYX_ERR(0, 125, __pyx_L1_error))
2906 __pyx_t_1 = (__pyx_v_A == Py_None);
2907 __pyx_t_2 = (__pyx_t_1 != 0);
2908 if (unlikely(__pyx_t_2)) {
2917 __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error))
2918 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
2919 __Pyx_GOTREF(__pyx_t_3);
2920 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2921 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2922 __PYX_ERR(0, 126, __pyx_L1_error)
2940 __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error))
2941 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
2942 __Pyx_GOTREF(__pyx_t_3);
2943 __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_2, 2, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
2944 __Pyx_GOTREF(__pyx_t_4);
2945 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2946 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
2947 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2948 if (unlikely(__pyx_t_2)) {
2957 __Pyx_TraceLine(129,0,__PYX_ERR(0, 129, __pyx_L1_error))
2958 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error)
2959 __Pyx_GOTREF(__pyx_t_4);
2960 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
2961 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2962 __PYX_ERR(0, 129, __pyx_L1_error)
2980 __Pyx_TraceLine(132,0,__PYX_ERR(0, 132, __pyx_L1_error))
2981 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error)
2982 __Pyx_GOTREF(__pyx_t_4);
2983 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 132, __pyx_L1_error)
2984 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2994 __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error))
2995 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float32");
3014 __Pyx_TraceLine(135,0,__PYX_ERR(0, 135, __pyx_L1_error))
3015 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
3016 __Pyx_GOTREF(__pyx_t_4);
3017 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 135, __pyx_L1_error)
3018 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3028 __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error))
3029 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float64");
3048 __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error))
3049 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error)
3050 __Pyx_GOTREF(__pyx_t_4);
3051 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 138, __pyx_L1_error)
3052 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3053 if (likely(__pyx_t_2)) {
3062 __Pyx_TraceLine(139,0,__PYX_ERR(0, 139, __pyx_L1_error))
3063 __pyx_v_self->__pyx_base.data_type_name = ((
char *)
"float128");
3082 __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error))
3084 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3085 __Pyx_GOTREF(__pyx_t_4);
3086 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3087 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3088 __PYX_ERR(0, 142, __pyx_L1_error)
3099 __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error))
3100 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_issparse);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
3101 __Pyx_GOTREF(__pyx_t_3);
3103 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3104 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3105 if (likely(__pyx_t_5)) {
3106 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3107 __Pyx_INCREF(__pyx_t_5);
3108 __Pyx_INCREF(
function);
3109 __Pyx_DECREF_SET(__pyx_t_3,
function);
3112 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3113 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3114 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3115 __Pyx_GOTREF(__pyx_t_4);
3116 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3117 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3118 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3128 __Pyx_TraceLine(149,0,__PYX_ERR(0, 149, __pyx_L1_error))
3129 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csr);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
3130 __Pyx_GOTREF(__pyx_t_3);
3132 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3133 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3134 if (likely(__pyx_t_5)) {
3135 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3136 __Pyx_INCREF(__pyx_t_5);
3137 __Pyx_INCREF(
function);
3138 __Pyx_DECREF_SET(__pyx_t_3,
function);
3141 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3142 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3143 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
3144 __Pyx_GOTREF(__pyx_t_4);
3145 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3146 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
3147 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3157 __Pyx_TraceLine(152,0,__PYX_ERR(0, 152, __pyx_L1_error))
3158 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
3159 __Pyx_GOTREF(__pyx_t_4);
3160 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
3161 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3162 __pyx_t_1 = ((!__pyx_t_2) != 0);
3172 __Pyx_TraceLine(153,0,__PYX_ERR(0, 153, __pyx_L1_error))
3173 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3174 __Pyx_GOTREF(__pyx_t_3);
3176 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3177 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3178 if (likely(__pyx_t_5)) {
3179 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3180 __Pyx_INCREF(__pyx_t_5);
3181 __Pyx_INCREF(
function);
3182 __Pyx_DECREF_SET(__pyx_t_3,
function);
3185 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3186 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3187 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
3188 __Pyx_GOTREF(__pyx_t_4);
3189 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3190 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3208 __Pyx_TraceLine(156,0,__PYX_ERR(0, 156, __pyx_L1_error))
3209 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
3210 __Pyx_GOTREF(__pyx_t_4);
3211 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
3212 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3222 __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error))
3223 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
3224 __Pyx_GOTREF(__pyx_t_3);
3226 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3227 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3228 if (likely(__pyx_t_5)) {
3229 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3230 __Pyx_INCREF(__pyx_t_5);
3231 __Pyx_INCREF(
function);
3232 __Pyx_DECREF_SET(__pyx_t_3,
function);
3235 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3236 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3237 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
3238 __Pyx_GOTREF(__pyx_t_4);
3239 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3240 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3259 __Pyx_TraceLine(159,0,__PYX_ERR(0, 159, __pyx_L1_error))
3260 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3261 __Pyx_GOTREF(__pyx_t_4);
3262 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
3263 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3273 __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error))
3274 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
3275 __Pyx_GOTREF(__pyx_t_3);
3277 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3278 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3279 if (likely(__pyx_t_5)) {
3280 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3281 __Pyx_INCREF(__pyx_t_5);
3282 __Pyx_INCREF(
function);
3283 __Pyx_DECREF_SET(__pyx_t_3,
function);
3286 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3287 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3288 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
3289 __Pyx_GOTREF(__pyx_t_4);
3290 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3291 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3310 __Pyx_TraceLine(162,0,__PYX_ERR(0, 162, __pyx_L1_error))
3311 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
3312 __Pyx_GOTREF(__pyx_t_4);
3313 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
3314 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3324 __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error))
3325 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3326 __Pyx_GOTREF(__pyx_t_3);
3328 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3329 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3330 if (likely(__pyx_t_5)) {
3331 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3332 __Pyx_INCREF(__pyx_t_5);
3333 __Pyx_INCREF(
function);
3334 __Pyx_DECREF_SET(__pyx_t_3,
function);
3337 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3338 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3339 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3340 __Pyx_GOTREF(__pyx_t_4);
3341 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3342 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3371 __Pyx_TraceLine(165,0,__PYX_ERR(0, 165, __pyx_L1_error))
3372 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csc);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
3373 __Pyx_GOTREF(__pyx_t_3);
3375 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3376 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3377 if (likely(__pyx_t_5)) {
3378 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3379 __Pyx_INCREF(__pyx_t_5);
3380 __Pyx_INCREF(
function);
3381 __Pyx_DECREF_SET(__pyx_t_3,
function);
3384 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3385 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3386 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3387 __Pyx_GOTREF(__pyx_t_4);
3388 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3389 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
3390 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3400 __Pyx_TraceLine(168,0,__PYX_ERR(0, 168, __pyx_L1_error))
3401 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
3402 __Pyx_GOTREF(__pyx_t_4);
3403 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
3404 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3405 __pyx_t_2 = ((!__pyx_t_1) != 0);
3415 __Pyx_TraceLine(169,0,__PYX_ERR(0, 169, __pyx_L1_error))
3416 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
3417 __Pyx_GOTREF(__pyx_t_3);
3419 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3420 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3421 if (likely(__pyx_t_5)) {
3422 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3423 __Pyx_INCREF(__pyx_t_5);
3424 __Pyx_INCREF(
function);
3425 __Pyx_DECREF_SET(__pyx_t_3,
function);
3428 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3429 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3430 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
3431 __Pyx_GOTREF(__pyx_t_4);
3432 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3433 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3451 __Pyx_TraceLine(172,0,__PYX_ERR(0, 172, __pyx_L1_error))
3452 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
3453 __Pyx_GOTREF(__pyx_t_4);
3454 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
3455 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3465 __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error))
3466 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
3467 __Pyx_GOTREF(__pyx_t_3);
3469 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3470 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3471 if (likely(__pyx_t_5)) {
3472 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3473 __Pyx_INCREF(__pyx_t_5);
3474 __Pyx_INCREF(
function);
3475 __Pyx_DECREF_SET(__pyx_t_3,
function);
3478 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3479 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3480 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3481 __Pyx_GOTREF(__pyx_t_4);
3482 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3483 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3502 __Pyx_TraceLine(175,0,__PYX_ERR(0, 175, __pyx_L1_error))
3503 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
3504 __Pyx_GOTREF(__pyx_t_4);
3505 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
3506 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3516 __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error))
3517 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
3518 __Pyx_GOTREF(__pyx_t_3);
3520 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3521 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3522 if (likely(__pyx_t_5)) {
3523 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3524 __Pyx_INCREF(__pyx_t_5);
3525 __Pyx_INCREF(
function);
3526 __Pyx_DECREF_SET(__pyx_t_3,
function);
3529 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3530 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3531 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
3532 __Pyx_GOTREF(__pyx_t_4);
3533 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3534 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3553 __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
3554 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
3555 __Pyx_GOTREF(__pyx_t_4);
3556 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
3557 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3567 __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error))
3568 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
3569 __Pyx_GOTREF(__pyx_t_3);
3571 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3572 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3573 if (likely(__pyx_t_5)) {
3574 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3575 __Pyx_INCREF(__pyx_t_5);
3576 __Pyx_INCREF(
function);
3577 __Pyx_DECREF_SET(__pyx_t_3,
function);
3580 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3581 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3582 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
3583 __Pyx_GOTREF(__pyx_t_4);
3584 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3585 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3614 __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error))
3616 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
3617 __Pyx_GOTREF(__pyx_t_3);
3619 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3620 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3621 if (likely(__pyx_t_5)) {
3622 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3623 __Pyx_INCREF(__pyx_t_5);
3624 __Pyx_INCREF(
function);
3625 __Pyx_DECREF_SET(__pyx_t_3,
function);
3628 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3629 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3630 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
3631 __Pyx_GOTREF(__pyx_t_4);
3632 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3633 __Pyx_GIVEREF(__pyx_t_4);
3634 __Pyx_GOTREF(__pyx_v_self->A_csr);
3635 __Pyx_DECREF(__pyx_v_self->A_csr);
3636 __pyx_v_self->A_csr = __pyx_t_4;
3646 __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error))
3647 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_has_sorted_indices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
3648 __Pyx_GOTREF(__pyx_t_4);
3649 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
3650 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3651 __pyx_t_1 = ((!__pyx_t_2) != 0);
3661 __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
3662 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_sort_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
3663 __Pyx_GOTREF(__pyx_t_3);
3665 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3666 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3667 if (likely(__pyx_t_5)) {
3668 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3669 __Pyx_INCREF(__pyx_t_5);
3670 __Pyx_INCREF(
function);
3671 __Pyx_DECREF_SET(__pyx_t_3,
function);
3674 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3675 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3676 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
3677 __Pyx_GOTREF(__pyx_t_4);
3678 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3679 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3697 __Pyx_TraceLine(191,0,__PYX_ERR(0, 191, __pyx_L1_error))
3698 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
3699 __Pyx_GOTREF(__pyx_t_4);
3700 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
3701 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3711 __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
3712 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
3713 __Pyx_GOTREF(__pyx_t_3);
3715 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3716 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3717 if (likely(__pyx_t_5)) {
3718 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3719 __Pyx_INCREF(__pyx_t_5);
3720 __Pyx_INCREF(
function);
3721 __Pyx_DECREF_SET(__pyx_t_3,
function);
3724 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
3725 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3726 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
3727 __Pyx_GOTREF(__pyx_t_4);
3728 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3729 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3748 __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error))
3749 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
3750 __Pyx_GOTREF(__pyx_t_4);
3751 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
3752 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3762 __Pyx_TraceLine(195,0,__PYX_ERR(0, 195, __pyx_L1_error))
3763 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
3764 __Pyx_GOTREF(__pyx_t_3);
3766 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3767 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3768 if (likely(__pyx_t_5)) {
3769 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3770 __Pyx_INCREF(__pyx_t_5);
3771 __Pyx_INCREF(
function);
3772 __Pyx_DECREF_SET(__pyx_t_3,
function);
3775 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
3776 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3777 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
3778 __Pyx_GOTREF(__pyx_t_4);
3779 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3780 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3799 __Pyx_TraceLine(197,0,__PYX_ERR(0, 197, __pyx_L1_error))
3800 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
3801 __Pyx_GOTREF(__pyx_t_4);
3802 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
3803 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3813 __Pyx_TraceLine(198,0,__PYX_ERR(0, 198, __pyx_L1_error))
3814 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
3815 __Pyx_GOTREF(__pyx_t_3);
3817 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3818 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3819 if (likely(__pyx_t_5)) {
3820 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3821 __Pyx_INCREF(__pyx_t_5);
3822 __Pyx_INCREF(
function);
3823 __Pyx_DECREF_SET(__pyx_t_3,
function);
3826 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
3827 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3828 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
3829 __Pyx_GOTREF(__pyx_t_4);
3830 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3831 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3862 __Pyx_TraceLine(203,0,__PYX_ERR(0, 203, __pyx_L1_error))
3864 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error)
3865 __Pyx_GOTREF(__pyx_t_4);
3866 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 203, __pyx_L1_error)
3867 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3877 __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
3878 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_float);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
3879 __Pyx_GOTREF(__pyx_t_3);
3881 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3882 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3883 if (likely(__pyx_t_5)) {
3884 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3885 __Pyx_INCREF(__pyx_t_5);
3886 __Pyx_INCREF(
function);
3887 __Pyx_DECREF_SET(__pyx_t_3,
function);
3890 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3891 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3892 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
3893 __Pyx_GOTREF(__pyx_t_4);
3894 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3895 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3914 __Pyx_TraceLine(206,0,__PYX_ERR(0, 206, __pyx_L1_error))
3915 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
3916 __Pyx_GOTREF(__pyx_t_4);
3917 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 206, __pyx_L1_error)
3918 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3928 __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
3929 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
3930 __Pyx_GOTREF(__pyx_t_3);
3932 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3933 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3934 if (likely(__pyx_t_5)) {
3935 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3936 __Pyx_INCREF(__pyx_t_5);
3937 __Pyx_INCREF(
function);
3938 __Pyx_DECREF_SET(__pyx_t_3,
function);
3941 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3942 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3943 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
3944 __Pyx_GOTREF(__pyx_t_4);
3945 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3946 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3965 __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error))
3966 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
3967 __Pyx_GOTREF(__pyx_t_4);
3968 __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 209, __pyx_L1_error)
3969 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3979 __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error))
3980 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_long_double);
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
3981 __Pyx_GOTREF(__pyx_t_3);
3983 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3984 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3985 if (likely(__pyx_t_5)) {
3986 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
3987 __Pyx_INCREF(__pyx_t_5);
3988 __Pyx_INCREF(
function);
3989 __Pyx_DECREF_SET(__pyx_t_3,
function);
3992 __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3993 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3994 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
3995 __Pyx_GOTREF(__pyx_t_4);
3996 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3997 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4023 __Pyx_XDECREF(__pyx_t_3);
4024 __Pyx_XDECREF(__pyx_t_4);
4025 __Pyx_XDECREF(__pyx_t_5);
4026 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4029 __Pyx_TraceReturn(Py_None, 0);
4030 __Pyx_RefNannyFinishContext();
4043 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
4044 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float[] =
"pycMatrix.set_dense_matrix_float(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4045 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float = {
"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float};
4046 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4047 PyObject *__pyx_r = 0;
4048 __Pyx_RefNannyDeclarations
4049 __Pyx_RefNannySetupContext(
"set_dense_matrix_float (wrapper)", 0);
4050 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4053 __Pyx_RefNannyFinishContext();
4057 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4058 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4059 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4060 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4061 __Pyx_memviewslice __pyx_v_A_data_float_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4062 __Pyx_memviewslice __pyx_v_A_data_float_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4063 float *__pyx_v_A_data_float;
4064 PyObject *__pyx_r = NULL;
4065 __Pyx_TraceDeclarations
4066 __Pyx_RefNannyDeclarations
4067 PyObject *__pyx_t_1 = NULL;
4068 PyObject *__pyx_t_2 = NULL;
4069 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4071 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4072 Py_ssize_t __pyx_t_6;
4073 Py_ssize_t __pyx_t_7;
4074 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4076 int __pyx_lineno = 0;
4077 const char *__pyx_filename = NULL;
4078 int __pyx_clineno = 0;
4079 __Pyx_TraceFrameInit(__pyx_codeobj__4)
4080 __Pyx_RefNannySetupContext(
"set_dense_matrix_float", 0);
4081 __Pyx_TraceCall(
"set_dense_matrix_float", __pyx_f[0], 216, 0, __PYX_ERR(0, 216, __pyx_L1_error));
4090 __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
4091 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
4092 __Pyx_GOTREF(__pyx_t_1);
4093 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
4094 __Pyx_GOTREF(__pyx_t_2);
4095 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4096 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
4097 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4098 __pyx_v_A_num_rows = __pyx_t_3;
4107 __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
4108 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
4109 __Pyx_GOTREF(__pyx_t_2);
4110 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
4111 __Pyx_GOTREF(__pyx_t_1);
4112 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4113 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error)
4114 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4115 __pyx_v_A_num_columns = __pyx_t_3;
4124 __Pyx_TraceLine(230,0,__PYX_ERR(0, 230, __pyx_L1_error))
4125 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4126 __Pyx_GOTREF(__pyx_t_1);
4127 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
4128 __Pyx_GOTREF(__pyx_t_2);
4129 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4130 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
4131 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4141 __Pyx_TraceLine(231,0,__PYX_ERR(0, 231, __pyx_L1_error))
4142 __pyx_v_A_is_row_major = 1;
4161 __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
4162 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
4163 __Pyx_GOTREF(__pyx_t_2);
4164 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
4165 __Pyx_GOTREF(__pyx_t_1);
4166 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4167 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
4168 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4169 if (likely(__pyx_t_4)) {
4178 __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
4179 __pyx_v_A_is_row_major = 0;
4198 __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
4200 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
4201 __Pyx_GOTREF(__pyx_t_1);
4202 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4204 __PYX_ERR(0, 235, __pyx_L1_error)
4215 __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
4216 __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4226 __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
4227 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 248, __pyx_L1_error)
4228 __pyx_v_A_data_float_mv_c = __pyx_t_5;
4229 __pyx_t_5.memview = NULL;
4230 __pyx_t_5.data = NULL;
4239 __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
4242 __pyx_v_A_data_float = (&(*((
float *) ( ((
char *) (((
float *) ( (__pyx_v_A_data_float_mv_c.data + __pyx_t_6 * __pyx_v_A_data_float_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4261 __Pyx_TraceLine(256,0,__PYX_ERR(0, 256, __pyx_L1_error))
4263 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 256, __pyx_L1_error)
4264 __pyx_v_A_data_float_mv_f = __pyx_t_8;
4265 __pyx_t_8.memview = NULL;
4266 __pyx_t_8.data = NULL;
4275 __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error))
4278 __pyx_v_A_data_float = (&(*((
float *) ( (( ((
char *) (((
float *) __pyx_v_A_data_float_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_float_mv_f.strides[1]) ))));
4289 __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error))
4291 __pyx_t_9 =
new cDenseMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4293 __Pyx_CppExn2PyErr();
4294 __PYX_ERR(0, 262, __pyx_L1_error)
4296 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
4307 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4310 __Pyx_XDECREF(__pyx_t_1);
4311 __Pyx_XDECREF(__pyx_t_2);
4312 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4313 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4314 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
4317 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_c, 1);
4318 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_f, 1);
4319 __Pyx_XGIVEREF(__pyx_r);
4320 __Pyx_TraceReturn(__pyx_r, 0);
4321 __Pyx_RefNannyFinishContext();
4334 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
4335 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double[] =
"pycMatrix.set_dense_matrix_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4336 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double = {
"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double};
4337 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4338 PyObject *__pyx_r = 0;
4339 __Pyx_RefNannyDeclarations
4340 __Pyx_RefNannySetupContext(
"set_dense_matrix_double (wrapper)", 0);
4341 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4344 __Pyx_RefNannyFinishContext();
4348 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4349 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4350 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4351 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4352 __Pyx_memviewslice __pyx_v_A_data_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4353 __Pyx_memviewslice __pyx_v_A_data_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4354 double *__pyx_v_A_data_double;
4355 PyObject *__pyx_r = NULL;
4356 __Pyx_TraceDeclarations
4357 __Pyx_RefNannyDeclarations
4358 PyObject *__pyx_t_1 = NULL;
4359 PyObject *__pyx_t_2 = NULL;
4360 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4362 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4363 Py_ssize_t __pyx_t_6;
4364 Py_ssize_t __pyx_t_7;
4365 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4367 int __pyx_lineno = 0;
4368 const char *__pyx_filename = NULL;
4369 int __pyx_clineno = 0;
4370 __Pyx_TraceFrameInit(__pyx_codeobj__6)
4371 __Pyx_RefNannySetupContext(
"set_dense_matrix_double", 0);
4372 __Pyx_TraceCall(
"set_dense_matrix_double", __pyx_f[0], 272, 0, __PYX_ERR(0, 272, __pyx_L1_error));
4381 __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error))
4382 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
4383 __Pyx_GOTREF(__pyx_t_1);
4384 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
4385 __Pyx_GOTREF(__pyx_t_2);
4386 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4387 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
4388 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4389 __pyx_v_A_num_rows = __pyx_t_3;
4398 __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error))
4399 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
4400 __Pyx_GOTREF(__pyx_t_2);
4401 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
4402 __Pyx_GOTREF(__pyx_t_1);
4403 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4404 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
4405 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4406 __pyx_v_A_num_columns = __pyx_t_3;
4415 __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error))
4416 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
4417 __Pyx_GOTREF(__pyx_t_1);
4418 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
4419 __Pyx_GOTREF(__pyx_t_2);
4420 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4421 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
4422 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4432 __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4433 __pyx_v_A_is_row_major = 1;
4452 __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4453 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
4454 __Pyx_GOTREF(__pyx_t_2);
4455 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
4456 __Pyx_GOTREF(__pyx_t_1);
4457 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4458 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
4459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4460 if (likely(__pyx_t_4)) {
4469 __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error))
4470 __pyx_v_A_is_row_major = 0;
4489 __Pyx_TraceLine(291,0,__PYX_ERR(0, 291, __pyx_L1_error))
4491 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
4492 __Pyx_GOTREF(__pyx_t_1);
4493 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4494 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4495 __PYX_ERR(0, 291, __pyx_L1_error)
4506 __Pyx_TraceLine(301,0,__PYX_ERR(0, 301, __pyx_L1_error))
4507 __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4517 __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error))
4518 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 304, __pyx_L1_error)
4519 __pyx_v_A_data_double_mv_c = __pyx_t_5;
4520 __pyx_t_5.memview = NULL;
4521 __pyx_t_5.data = NULL;
4530 __Pyx_TraceLine(307,0,__PYX_ERR(0, 307, __pyx_L1_error))
4533 __pyx_v_A_data_double = (&(*((
double *) ( ((
char *) (((
double *) ( (__pyx_v_A_data_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4552 __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error))
4554 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 312, __pyx_L1_error)
4555 __pyx_v_A_data_double_mv_f = __pyx_t_8;
4556 __pyx_t_8.memview = NULL;
4557 __pyx_t_8.data = NULL;
4566 __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error))
4569 __pyx_v_A_data_double = (&(*((
double *) ( (( ((
char *) (((
double *) __pyx_v_A_data_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_double_mv_f.strides[1]) ))));
4580 __Pyx_TraceLine(318,0,__PYX_ERR(0, 318, __pyx_L1_error))
4582 __pyx_t_9 =
new cDenseMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4584 __Pyx_CppExn2PyErr();
4585 __PYX_ERR(0, 318, __pyx_L1_error)
4587 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
4598 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4601 __Pyx_XDECREF(__pyx_t_1);
4602 __Pyx_XDECREF(__pyx_t_2);
4603 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4604 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4605 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4608 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_c, 1);
4609 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_f, 1);
4610 __Pyx_XGIVEREF(__pyx_r);
4611 __Pyx_TraceReturn(__pyx_r, 0);
4612 __Pyx_RefNannyFinishContext();
4625 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
4626 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double[] =
"pycMatrix.set_dense_matrix_long_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4627 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double = {
"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double};
4628 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4629 PyObject *__pyx_r = 0;
4630 __Pyx_RefNannyDeclarations
4631 __Pyx_RefNannySetupContext(
"set_dense_matrix_long_double (wrapper)", 0);
4632 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4635 __Pyx_RefNannyFinishContext();
4639 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4640 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4641 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4642 __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4643 __Pyx_memviewslice __pyx_v_A_data_long_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4644 __Pyx_memviewslice __pyx_v_A_data_long_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4645 long double *__pyx_v_A_data_long_double;
4646 PyObject *__pyx_r = NULL;
4647 __Pyx_TraceDeclarations
4648 __Pyx_RefNannyDeclarations
4649 PyObject *__pyx_t_1 = NULL;
4650 PyObject *__pyx_t_2 = NULL;
4651 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4653 __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4654 Py_ssize_t __pyx_t_6;
4655 Py_ssize_t __pyx_t_7;
4656 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4658 int __pyx_lineno = 0;
4659 const char *__pyx_filename = NULL;
4660 int __pyx_clineno = 0;
4661 __Pyx_TraceFrameInit(__pyx_codeobj__7)
4662 __Pyx_RefNannySetupContext(
"set_dense_matrix_long_double", 0);
4663 __Pyx_TraceCall(
"set_dense_matrix_long_double", __pyx_f[0], 328, 0, __PYX_ERR(0, 328, __pyx_L1_error));
4672 __Pyx_TraceLine(337,0,__PYX_ERR(0, 337, __pyx_L1_error))
4673 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
4674 __Pyx_GOTREF(__pyx_t_1);
4675 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
4676 __Pyx_GOTREF(__pyx_t_2);
4677 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4678 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
4679 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4680 __pyx_v_A_num_rows = __pyx_t_3;
4689 __Pyx_TraceLine(338,0,__PYX_ERR(0, 338, __pyx_L1_error))
4690 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
4691 __Pyx_GOTREF(__pyx_t_2);
4692 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
4693 __Pyx_GOTREF(__pyx_t_1);
4694 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4695 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
4696 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4697 __pyx_v_A_num_columns = __pyx_t_3;
4706 __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error))
4707 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
4708 __Pyx_GOTREF(__pyx_t_1);
4709 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
4710 __Pyx_GOTREF(__pyx_t_2);
4711 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4712 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
4713 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4723 __Pyx_TraceLine(343,0,__PYX_ERR(0, 343, __pyx_L1_error))
4724 __pyx_v_A_is_row_major = 1;
4743 __Pyx_TraceLine(344,0,__PYX_ERR(0, 344, __pyx_L1_error))
4744 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
4745 __Pyx_GOTREF(__pyx_t_2);
4746 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
4747 __Pyx_GOTREF(__pyx_t_1);
4748 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4749 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1);
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 344, __pyx_L1_error)
4750 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4751 if (likely(__pyx_t_4)) {
4760 __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error))
4761 __pyx_v_A_is_row_major = 0;
4780 __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error))
4782 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
4783 __Pyx_GOTREF(__pyx_t_1);
4784 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4785 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4786 __PYX_ERR(0, 347, __pyx_L1_error)
4797 __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error))
4798 __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4808 __Pyx_TraceLine(360,0,__PYX_ERR(0, 360, __pyx_L1_error))
4809 __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 360, __pyx_L1_error)
4810 __pyx_v_A_data_long_double_mv_c = __pyx_t_5;
4811 __pyx_t_5.memview = NULL;
4812 __pyx_t_5.data = NULL;
4821 __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error))
4824 __pyx_v_A_data_long_double = (&(*((
long double *) ( ((
char *) (((
long double *) ( (__pyx_v_A_data_long_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_long_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4843 __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error))
4845 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_A, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 368, __pyx_L1_error)
4846 __pyx_v_A_data_long_double_mv_f = __pyx_t_8;
4847 __pyx_t_8.memview = NULL;
4848 __pyx_t_8.data = NULL;
4857 __Pyx_TraceLine(371,0,__PYX_ERR(0, 371, __pyx_L1_error))
4860 __pyx_v_A_data_long_double = (&(*((
long double *) ( (( ((
char *) (((
long double *) __pyx_v_A_data_long_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_long_double_mv_f.strides[1]) ))));
4871 __Pyx_TraceLine(374,0,__PYX_ERR(0, 374, __pyx_L1_error))
4873 __pyx_t_9 =
new cDenseMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4875 __Pyx_CppExn2PyErr();
4876 __PYX_ERR(0, 374, __pyx_L1_error)
4878 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
4889 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4892 __Pyx_XDECREF(__pyx_t_1);
4893 __Pyx_XDECREF(__pyx_t_2);
4894 __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4895 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4896 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4899 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_c, 1);
4900 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_f, 1);
4901 __Pyx_XGIVEREF(__pyx_r);
4902 __Pyx_TraceReturn(__pyx_r, 0);
4903 __Pyx_RefNannyFinishContext();
4916 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
4917 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float[] =
"pycMatrix.set_csr_matrix_float(self, A)\n\n ";
4918 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float = {
"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float};
4919 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4920 PyObject *__pyx_r = 0;
4921 __Pyx_RefNannyDeclarations
4922 __Pyx_RefNannySetupContext(
"set_csr_matrix_float (wrapper)", 0);
4923 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4926 __Pyx_RefNannyFinishContext();
4930 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4931 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4932 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4933 __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
4934 float *__pyx_v_A_data_float;
4935 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
4936 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
4937 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
4938 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
4939 PyObject *__pyx_r = NULL;
4940 __Pyx_TraceDeclarations
4941 __Pyx_RefNannyDeclarations
4942 PyObject *__pyx_t_1 = NULL;
4943 PyObject *__pyx_t_2 = NULL;
4944 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4945 PyObject *__pyx_t_4 = NULL;
4946 PyObject *__pyx_t_5 = NULL;
4947 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4948 Py_ssize_t __pyx_t_7;
4949 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4951 int __pyx_lineno = 0;
4952 const char *__pyx_filename = NULL;
4953 int __pyx_clineno = 0;
4954 __Pyx_TraceFrameInit(__pyx_codeobj__8)
4955 __Pyx_RefNannySetupContext(
"set_csr_matrix_float", 0);
4956 __Pyx_TraceCall(
"set_csr_matrix_float", __pyx_f[0], 384, 0, __PYX_ERR(0, 384, __pyx_L1_error));
4965 __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error))
4966 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
4967 __Pyx_GOTREF(__pyx_t_1);
4968 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
4969 __Pyx_GOTREF(__pyx_t_2);
4970 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4971 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error)
4972 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4973 __pyx_v_A_num_rows = __pyx_t_3;
4982 __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
4983 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
4984 __Pyx_GOTREF(__pyx_t_2);
4985 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
4986 __Pyx_GOTREF(__pyx_t_1);
4987 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4988 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error)
4989 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4990 __pyx_v_A_num_columns = __pyx_t_3;
4999 __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error))
5000 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5001 __Pyx_GOTREF(__pyx_t_1);
5002 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
5003 __Pyx_GOTREF(__pyx_t_2);
5004 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5005 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5006 __Pyx_GOTREF(__pyx_t_1);
5007 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
5008 __Pyx_GOTREF(__pyx_t_4);
5009 __Pyx_GIVEREF(__pyx_t_1);
5010 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5012 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5013 __Pyx_GOTREF(__pyx_t_1);
5014 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
5015 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
5016 __Pyx_GOTREF(__pyx_t_5);
5017 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5018 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5019 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5028 __Pyx_TraceLine(399,0,__PYX_ERR(0, 399, __pyx_L1_error))
5029 __Pyx_GIVEREF(__pyx_t_5);
5030 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5031 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5032 __pyx_v_self->A_indices_copy = __pyx_t_5;
5042 __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
5043 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5044 __Pyx_GOTREF(__pyx_t_5);
5045 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
5046 __Pyx_GOTREF(__pyx_t_1);
5047 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5048 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5049 __Pyx_GOTREF(__pyx_t_5);
5050 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
5051 __Pyx_GOTREF(__pyx_t_4);
5052 __Pyx_GIVEREF(__pyx_t_5);
5053 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5055 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5056 __Pyx_GOTREF(__pyx_t_5);
5057 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
5058 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
5059 __Pyx_GOTREF(__pyx_t_2);
5060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5061 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5062 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5071 __Pyx_TraceLine(401,0,__PYX_ERR(0, 401, __pyx_L1_error))
5072 __Pyx_GIVEREF(__pyx_t_2);
5073 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5074 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5075 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5085 __Pyx_TraceLine(405,0,__PYX_ERR(0, 405, __pyx_L1_error))
5086 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 405, __pyx_L1_error)
5087 __pyx_v_A_indices_mv = __pyx_t_6;
5088 __pyx_t_6.memview = NULL;
5089 __pyx_t_6.data = NULL;
5098 __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error))
5099 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 407, __pyx_L1_error)
5100 __pyx_v_A_index_pointer_mv = __pyx_t_6;
5101 __pyx_t_6.memview = NULL;
5102 __pyx_t_6.data = NULL;
5111 __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error))
5113 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5122 __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5124 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5133 __Pyx_TraceLine(414,0,__PYX_ERR(0, 414, __pyx_L1_error))
5134 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
5135 __Pyx_GOTREF(__pyx_t_2);
5136 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 414, __pyx_L1_error)
5137 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5138 __pyx_v_A_data_float_mv = __pyx_t_8;
5139 __pyx_t_8.memview = NULL;
5140 __pyx_t_8.data = NULL;
5149 __Pyx_TraceLine(417,0,__PYX_ERR(0, 417, __pyx_L1_error))
5151 __pyx_v_A_data_float = (&(*((
float *) ( (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
5160 __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error))
5162 __pyx_t_9 =
new cCSRMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5164 __Pyx_CppExn2PyErr();
5165 __PYX_ERR(0, 420, __pyx_L1_error)
5167 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
5178 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5181 __Pyx_XDECREF(__pyx_t_1);
5182 __Pyx_XDECREF(__pyx_t_2);
5183 __Pyx_XDECREF(__pyx_t_4);
5184 __Pyx_XDECREF(__pyx_t_5);
5185 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5186 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5187 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5190 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
5191 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5192 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5193 __Pyx_XGIVEREF(__pyx_r);
5194 __Pyx_TraceReturn(__pyx_r, 0);
5195 __Pyx_RefNannyFinishContext();
5208 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
5209 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double[] =
"pycMatrix.set_csr_matrix_double(self, A)\n\n ";
5210 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double = {
"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double};
5211 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5212 PyObject *__pyx_r = 0;
5213 __Pyx_RefNannyDeclarations
5214 __Pyx_RefNannySetupContext(
"set_csr_matrix_double (wrapper)", 0);
5215 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5218 __Pyx_RefNannyFinishContext();
5222 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5223 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5224 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5225 __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5226 double *__pyx_v_A_data_double;
5227 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5228 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5229 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5230 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5231 PyObject *__pyx_r = NULL;
5232 __Pyx_TraceDeclarations
5233 __Pyx_RefNannyDeclarations
5234 PyObject *__pyx_t_1 = NULL;
5235 PyObject *__pyx_t_2 = NULL;
5236 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5237 PyObject *__pyx_t_4 = NULL;
5238 PyObject *__pyx_t_5 = NULL;
5239 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5240 Py_ssize_t __pyx_t_7;
5241 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5243 int __pyx_lineno = 0;
5244 const char *__pyx_filename = NULL;
5245 int __pyx_clineno = 0;
5246 __Pyx_TraceFrameInit(__pyx_codeobj__9)
5247 __Pyx_RefNannySetupContext(
"set_csr_matrix_double", 0);
5248 __Pyx_TraceCall(
"set_csr_matrix_double", __pyx_f[0], 431, 0, __PYX_ERR(0, 431, __pyx_L1_error));
5257 __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error))
5258 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
5259 __Pyx_GOTREF(__pyx_t_1);
5260 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
5261 __Pyx_GOTREF(__pyx_t_2);
5262 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5263 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error)
5264 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5265 __pyx_v_A_num_rows = __pyx_t_3;
5274 __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error))
5275 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
5276 __Pyx_GOTREF(__pyx_t_2);
5277 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
5278 __Pyx_GOTREF(__pyx_t_1);
5279 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5280 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error)
5281 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5282 __pyx_v_A_num_columns = __pyx_t_3;
5291 __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error))
5292 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5293 __Pyx_GOTREF(__pyx_t_1);
5294 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
5295 __Pyx_GOTREF(__pyx_t_2);
5296 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5297 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5298 __Pyx_GOTREF(__pyx_t_1);
5299 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error)
5300 __Pyx_GOTREF(__pyx_t_4);
5301 __Pyx_GIVEREF(__pyx_t_1);
5302 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5304 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5305 __Pyx_GOTREF(__pyx_t_1);
5306 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
5307 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error)
5308 __Pyx_GOTREF(__pyx_t_5);
5309 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5310 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5311 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5320 __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error))
5321 __Pyx_GIVEREF(__pyx_t_5);
5322 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5323 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5324 __pyx_v_self->A_indices_copy = __pyx_t_5;
5334 __Pyx_TraceLine(449,0,__PYX_ERR(0, 449, __pyx_L1_error))
5335 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5336 __Pyx_GOTREF(__pyx_t_5);
5337 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
5338 __Pyx_GOTREF(__pyx_t_1);
5339 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5340 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5341 __Pyx_GOTREF(__pyx_t_5);
5342 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
5343 __Pyx_GOTREF(__pyx_t_4);
5344 __Pyx_GIVEREF(__pyx_t_5);
5345 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5347 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5348 __Pyx_GOTREF(__pyx_t_5);
5349 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 449, __pyx_L1_error)
5350 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
5351 __Pyx_GOTREF(__pyx_t_2);
5352 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5353 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5354 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5363 __Pyx_TraceLine(448,0,__PYX_ERR(0, 448, __pyx_L1_error))
5364 __Pyx_GIVEREF(__pyx_t_2);
5365 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5366 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5367 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5377 __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error))
5378 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 452, __pyx_L1_error)
5379 __pyx_v_A_indices_mv = __pyx_t_6;
5380 __pyx_t_6.memview = NULL;
5381 __pyx_t_6.data = NULL;
5390 __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error))
5391 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 454, __pyx_L1_error)
5392 __pyx_v_A_index_pointer_mv = __pyx_t_6;
5393 __pyx_t_6.memview = NULL;
5394 __pyx_t_6.data = NULL;
5403 __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error))
5405 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5414 __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
5416 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5425 __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
5426 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
5427 __Pyx_GOTREF(__pyx_t_2);
5428 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 461, __pyx_L1_error)
5429 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5430 __pyx_v_A_data_double_mv = __pyx_t_8;
5431 __pyx_t_8.memview = NULL;
5432 __pyx_t_8.data = NULL;
5441 __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error))
5443 __pyx_v_A_data_double = (&(*((
double *) ( (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
5452 __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error))
5454 __pyx_t_9 =
new cCSRMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5456 __Pyx_CppExn2PyErr();
5457 __PYX_ERR(0, 467, __pyx_L1_error)
5459 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
5470 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5473 __Pyx_XDECREF(__pyx_t_1);
5474 __Pyx_XDECREF(__pyx_t_2);
5475 __Pyx_XDECREF(__pyx_t_4);
5476 __Pyx_XDECREF(__pyx_t_5);
5477 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5478 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5479 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5482 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
5483 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5484 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5485 __Pyx_XGIVEREF(__pyx_r);
5486 __Pyx_TraceReturn(__pyx_r, 0);
5487 __Pyx_RefNannyFinishContext();
5500 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
5501 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double[] =
"pycMatrix.set_csr_matrix_long_double(self, A)\n\n ";
5502 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double = {
"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double};
5503 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5504 PyObject *__pyx_r = 0;
5505 __Pyx_RefNannyDeclarations
5506 __Pyx_RefNannySetupContext(
"set_csr_matrix_long_double (wrapper)", 0);
5507 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5510 __Pyx_RefNannyFinishContext();
5514 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5515 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5516 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5517 __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5518 long double *__pyx_v_A_data_long_double;
5519 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5520 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5521 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5522 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5523 PyObject *__pyx_r = NULL;
5524 __Pyx_TraceDeclarations
5525 __Pyx_RefNannyDeclarations
5526 PyObject *__pyx_t_1 = NULL;
5527 PyObject *__pyx_t_2 = NULL;
5528 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5529 PyObject *__pyx_t_4 = NULL;
5530 PyObject *__pyx_t_5 = NULL;
5531 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5532 Py_ssize_t __pyx_t_7;
5533 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5535 int __pyx_lineno = 0;
5536 const char *__pyx_filename = NULL;
5537 int __pyx_clineno = 0;
5538 __Pyx_TraceFrameInit(__pyx_codeobj__10)
5539 __Pyx_RefNannySetupContext(
"set_csr_matrix_long_double", 0);
5540 __Pyx_TraceCall(
"set_csr_matrix_long_double", __pyx_f[0], 478, 0, __PYX_ERR(0, 478, __pyx_L1_error));
5549 __Pyx_TraceLine(483,0,__PYX_ERR(0, 483, __pyx_L1_error))
5550 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
5551 __Pyx_GOTREF(__pyx_t_1);
5552 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
5553 __Pyx_GOTREF(__pyx_t_2);
5554 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5555 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L1_error)
5556 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5557 __pyx_v_A_num_rows = __pyx_t_3;
5566 __Pyx_TraceLine(484,0,__PYX_ERR(0, 484, __pyx_L1_error))
5567 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
5568 __Pyx_GOTREF(__pyx_t_2);
5569 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
5570 __Pyx_GOTREF(__pyx_t_1);
5571 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5572 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L1_error)
5573 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5574 __pyx_v_A_num_columns = __pyx_t_3;
5583 __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error))
5584 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5585 __Pyx_GOTREF(__pyx_t_1);
5586 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
5587 __Pyx_GOTREF(__pyx_t_2);
5588 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5589 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5590 __Pyx_GOTREF(__pyx_t_1);
5591 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
5592 __Pyx_GOTREF(__pyx_t_4);
5593 __Pyx_GIVEREF(__pyx_t_1);
5594 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5596 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5597 __Pyx_GOTREF(__pyx_t_1);
5598 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 494, __pyx_L1_error)
5599 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
5600 __Pyx_GOTREF(__pyx_t_5);
5601 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5602 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5603 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5612 __Pyx_TraceLine(493,0,__PYX_ERR(0, 493, __pyx_L1_error))
5613 __Pyx_GIVEREF(__pyx_t_5);
5614 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5615 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5616 __pyx_v_self->A_indices_copy = __pyx_t_5;
5626 __Pyx_TraceLine(496,0,__PYX_ERR(0, 496, __pyx_L1_error))
5627 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5628 __Pyx_GOTREF(__pyx_t_5);
5629 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
5630 __Pyx_GOTREF(__pyx_t_1);
5631 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5632 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5633 __Pyx_GOTREF(__pyx_t_5);
5634 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
5635 __Pyx_GOTREF(__pyx_t_4);
5636 __Pyx_GIVEREF(__pyx_t_5);
5637 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5639 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5640 __Pyx_GOTREF(__pyx_t_5);
5641 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
5642 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
5643 __Pyx_GOTREF(__pyx_t_2);
5644 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5645 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5646 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5655 __Pyx_TraceLine(495,0,__PYX_ERR(0, 495, __pyx_L1_error))
5656 __Pyx_GIVEREF(__pyx_t_2);
5657 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5658 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5659 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5669 __Pyx_TraceLine(499,0,__PYX_ERR(0, 499, __pyx_L1_error))
5670 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 499, __pyx_L1_error)
5671 __pyx_v_A_indices_mv = __pyx_t_6;
5672 __pyx_t_6.memview = NULL;
5673 __pyx_t_6.data = NULL;
5682 __Pyx_TraceLine(501,0,__PYX_ERR(0, 501, __pyx_L1_error))
5683 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 501, __pyx_L1_error)
5684 __pyx_v_A_index_pointer_mv = __pyx_t_6;
5685 __pyx_t_6.memview = NULL;
5686 __pyx_t_6.data = NULL;
5695 __Pyx_TraceLine(504,0,__PYX_ERR(0, 504, __pyx_L1_error))
5697 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5706 __Pyx_TraceLine(505,0,__PYX_ERR(0, 505, __pyx_L1_error))
5708 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5717 __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
5718 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
5719 __Pyx_GOTREF(__pyx_t_2);
5720 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 508, __pyx_L1_error)
5721 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5722 __pyx_v_A_data_long_double_mv = __pyx_t_8;
5723 __pyx_t_8.memview = NULL;
5724 __pyx_t_8.data = NULL;
5733 __Pyx_TraceLine(511,0,__PYX_ERR(0, 511, __pyx_L1_error))
5735 __pyx_v_A_data_long_double = (&(*((
long double *) ( (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
5744 __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error))
5746 __pyx_t_9 =
new cCSRMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5748 __Pyx_CppExn2PyErr();
5749 __PYX_ERR(0, 514, __pyx_L1_error)
5751 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
5762 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5765 __Pyx_XDECREF(__pyx_t_1);
5766 __Pyx_XDECREF(__pyx_t_2);
5767 __Pyx_XDECREF(__pyx_t_4);
5768 __Pyx_XDECREF(__pyx_t_5);
5769 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5770 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5771 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5774 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
5775 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5776 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5777 __Pyx_XGIVEREF(__pyx_r);
5778 __Pyx_TraceReturn(__pyx_r, 0);
5779 __Pyx_RefNannyFinishContext();
5792 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
5793 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float[] =
"pycMatrix.set_csc_matrix_float(self, A)\n\n ";
5794 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float = {
"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float};
5795 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5796 PyObject *__pyx_r = 0;
5797 __Pyx_RefNannyDeclarations
5798 __Pyx_RefNannySetupContext(
"set_csc_matrix_float (wrapper)", 0);
5799 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5802 __Pyx_RefNannyFinishContext();
5806 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5807 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5808 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5809 __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5810 float *__pyx_v_A_data_float;
5811 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5812 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5813 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5814 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5815 PyObject *__pyx_r = NULL;
5816 __Pyx_TraceDeclarations
5817 __Pyx_RefNannyDeclarations
5818 PyObject *__pyx_t_1 = NULL;
5819 PyObject *__pyx_t_2 = NULL;
5820 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5821 PyObject *__pyx_t_4 = NULL;
5822 PyObject *__pyx_t_5 = NULL;
5823 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5824 Py_ssize_t __pyx_t_7;
5825 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5827 int __pyx_lineno = 0;
5828 const char *__pyx_filename = NULL;
5829 int __pyx_clineno = 0;
5830 __Pyx_TraceFrameInit(__pyx_codeobj__11)
5831 __Pyx_RefNannySetupContext(
"set_csc_matrix_float", 0);
5832 __Pyx_TraceCall(
"set_csc_matrix_float", __pyx_f[0], 525, 0, __PYX_ERR(0, 525, __pyx_L1_error));
5841 __Pyx_TraceLine(530,0,__PYX_ERR(0, 530, __pyx_L1_error))
5842 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
5843 __Pyx_GOTREF(__pyx_t_1);
5844 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
5845 __Pyx_GOTREF(__pyx_t_2);
5846 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5847 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
5848 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5849 __pyx_v_A_num_rows = __pyx_t_3;
5858 __Pyx_TraceLine(531,0,__PYX_ERR(0, 531, __pyx_L1_error))
5859 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
5860 __Pyx_GOTREF(__pyx_t_2);
5861 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
5862 __Pyx_GOTREF(__pyx_t_1);
5863 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5864 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L1_error)
5865 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5866 __pyx_v_A_num_columns = __pyx_t_3;
5875 __Pyx_TraceLine(541,0,__PYX_ERR(0, 541, __pyx_L1_error))
5876 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
5877 __Pyx_GOTREF(__pyx_t_1);
5878 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
5879 __Pyx_GOTREF(__pyx_t_2);
5880 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5881 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
5882 __Pyx_GOTREF(__pyx_t_1);
5883 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
5884 __Pyx_GOTREF(__pyx_t_4);
5885 __Pyx_GIVEREF(__pyx_t_1);
5886 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5888 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
5889 __Pyx_GOTREF(__pyx_t_1);
5890 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
5891 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
5892 __Pyx_GOTREF(__pyx_t_5);
5893 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5894 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5895 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5904 __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
5905 __Pyx_GIVEREF(__pyx_t_5);
5906 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5907 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5908 __pyx_v_self->A_indices_copy = __pyx_t_5;
5918 __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error))
5919 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
5920 __Pyx_GOTREF(__pyx_t_5);
5921 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
5922 __Pyx_GOTREF(__pyx_t_1);
5923 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5924 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
5925 __Pyx_GOTREF(__pyx_t_5);
5926 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
5927 __Pyx_GOTREF(__pyx_t_4);
5928 __Pyx_GIVEREF(__pyx_t_5);
5929 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5931 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
5932 __Pyx_GOTREF(__pyx_t_5);
5933 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 543, __pyx_L1_error)
5934 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
5935 __Pyx_GOTREF(__pyx_t_2);
5936 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5937 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5938 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5947 __Pyx_TraceLine(542,0,__PYX_ERR(0, 542, __pyx_L1_error))
5948 __Pyx_GIVEREF(__pyx_t_2);
5949 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5950 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5951 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5961 __Pyx_TraceLine(546,0,__PYX_ERR(0, 546, __pyx_L1_error))
5962 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 546, __pyx_L1_error)
5963 __pyx_v_A_indices_mv = __pyx_t_6;
5964 __pyx_t_6.memview = NULL;
5965 __pyx_t_6.data = NULL;
5974 __Pyx_TraceLine(548,0,__PYX_ERR(0, 548, __pyx_L1_error))
5975 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 548, __pyx_L1_error)
5976 __pyx_v_A_index_pointer_mv = __pyx_t_6;
5977 __pyx_t_6.memview = NULL;
5978 __pyx_t_6.data = NULL;
5987 __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error))
5989 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5998 __Pyx_TraceLine(552,0,__PYX_ERR(0, 552, __pyx_L1_error))
6000 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6009 __Pyx_TraceLine(555,0,__PYX_ERR(0, 555, __pyx_L1_error))
6010 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error)
6011 __Pyx_GOTREF(__pyx_t_2);
6012 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 555, __pyx_L1_error)
6013 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6014 __pyx_v_A_data_float_mv = __pyx_t_8;
6015 __pyx_t_8.memview = NULL;
6016 __pyx_t_8.data = NULL;
6025 __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error))
6027 __pyx_v_A_data_float = (&(*((
float *) ( (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
6036 __Pyx_TraceLine(561,0,__PYX_ERR(0, 561, __pyx_L1_error))
6038 __pyx_t_9 =
new cCSCMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6040 __Pyx_CppExn2PyErr();
6041 __PYX_ERR(0, 561, __pyx_L1_error)
6043 __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
6054 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6057 __Pyx_XDECREF(__pyx_t_1);
6058 __Pyx_XDECREF(__pyx_t_2);
6059 __Pyx_XDECREF(__pyx_t_4);
6060 __Pyx_XDECREF(__pyx_t_5);
6061 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6062 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6063 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
6066 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
6067 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6068 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6069 __Pyx_XGIVEREF(__pyx_r);
6070 __Pyx_TraceReturn(__pyx_r, 0);
6071 __Pyx_RefNannyFinishContext();
6084 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
6085 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double[] =
"pycMatrix.set_csc_matrix_double(self, A)\n\n ";
6086 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double = {
"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double};
6087 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6088 PyObject *__pyx_r = 0;
6089 __Pyx_RefNannyDeclarations
6090 __Pyx_RefNannySetupContext(
"set_csc_matrix_double (wrapper)", 0);
6091 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6094 __Pyx_RefNannyFinishContext();
6098 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6099 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6100 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6101 __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6102 double *__pyx_v_A_data_double;
6103 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6104 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6105 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
6106 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
6107 PyObject *__pyx_r = NULL;
6108 __Pyx_TraceDeclarations
6109 __Pyx_RefNannyDeclarations
6110 PyObject *__pyx_t_1 = NULL;
6111 PyObject *__pyx_t_2 = NULL;
6112 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6113 PyObject *__pyx_t_4 = NULL;
6114 PyObject *__pyx_t_5 = NULL;
6115 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6116 Py_ssize_t __pyx_t_7;
6117 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6119 int __pyx_lineno = 0;
6120 const char *__pyx_filename = NULL;
6121 int __pyx_clineno = 0;
6122 __Pyx_TraceFrameInit(__pyx_codeobj__12)
6123 __Pyx_RefNannySetupContext(
"set_csc_matrix_double", 0);
6124 __Pyx_TraceCall(
"set_csc_matrix_double", __pyx_f[0], 572, 0, __PYX_ERR(0, 572, __pyx_L1_error));
6133 __Pyx_TraceLine(577,0,__PYX_ERR(0, 577, __pyx_L1_error))
6134 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
6135 __Pyx_GOTREF(__pyx_t_1);
6136 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
6137 __Pyx_GOTREF(__pyx_t_2);
6138 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6139 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L1_error)
6140 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6141 __pyx_v_A_num_rows = __pyx_t_3;
6150 __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error))
6151 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
6152 __Pyx_GOTREF(__pyx_t_2);
6153 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
6154 __Pyx_GOTREF(__pyx_t_1);
6155 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6156 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L1_error)
6157 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6158 __pyx_v_A_num_columns = __pyx_t_3;
6167 __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error))
6168 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6169 __Pyx_GOTREF(__pyx_t_1);
6170 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
6171 __Pyx_GOTREF(__pyx_t_2);
6172 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6173 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6174 __Pyx_GOTREF(__pyx_t_1);
6175 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
6176 __Pyx_GOTREF(__pyx_t_4);
6177 __Pyx_GIVEREF(__pyx_t_1);
6178 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6180 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6181 __Pyx_GOTREF(__pyx_t_1);
6182 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 588, __pyx_L1_error)
6183 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error)
6184 __Pyx_GOTREF(__pyx_t_5);
6185 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6186 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6187 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6196 __Pyx_TraceLine(587,0,__PYX_ERR(0, 587, __pyx_L1_error))
6197 __Pyx_GIVEREF(__pyx_t_5);
6198 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6199 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6200 __pyx_v_self->A_indices_copy = __pyx_t_5;
6210 __Pyx_TraceLine(590,0,__PYX_ERR(0, 590, __pyx_L1_error))
6211 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6212 __Pyx_GOTREF(__pyx_t_5);
6213 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
6214 __Pyx_GOTREF(__pyx_t_1);
6215 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6216 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6217 __Pyx_GOTREF(__pyx_t_5);
6218 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
6219 __Pyx_GOTREF(__pyx_t_4);
6220 __Pyx_GIVEREF(__pyx_t_5);
6221 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6223 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6224 __Pyx_GOTREF(__pyx_t_5);
6225 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
6226 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
6227 __Pyx_GOTREF(__pyx_t_2);
6228 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6229 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6230 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6239 __Pyx_TraceLine(589,0,__PYX_ERR(0, 589, __pyx_L1_error))
6240 __Pyx_GIVEREF(__pyx_t_2);
6241 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6242 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6243 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6253 __Pyx_TraceLine(593,0,__PYX_ERR(0, 593, __pyx_L1_error))
6254 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 593, __pyx_L1_error)
6255 __pyx_v_A_indices_mv = __pyx_t_6;
6256 __pyx_t_6.memview = NULL;
6257 __pyx_t_6.data = NULL;
6266 __Pyx_TraceLine(595,0,__PYX_ERR(0, 595, __pyx_L1_error))
6267 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 595, __pyx_L1_error)
6268 __pyx_v_A_index_pointer_mv = __pyx_t_6;
6269 __pyx_t_6.memview = NULL;
6270 __pyx_t_6.data = NULL;
6279 __Pyx_TraceLine(598,0,__PYX_ERR(0, 598, __pyx_L1_error))
6281 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6290 __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error))
6292 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6301 __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error))
6302 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
6303 __Pyx_GOTREF(__pyx_t_2);
6304 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 602, __pyx_L1_error)
6305 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6306 __pyx_v_A_data_double_mv = __pyx_t_8;
6307 __pyx_t_8.memview = NULL;
6308 __pyx_t_8.data = NULL;
6317 __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error))
6319 __pyx_v_A_data_double = (&(*((
double *) ( (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
6328 __Pyx_TraceLine(608,0,__PYX_ERR(0, 608, __pyx_L1_error))
6330 __pyx_t_9 =
new cCSCMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6332 __Pyx_CppExn2PyErr();
6333 __PYX_ERR(0, 608, __pyx_L1_error)
6335 __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
6346 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6349 __Pyx_XDECREF(__pyx_t_1);
6350 __Pyx_XDECREF(__pyx_t_2);
6351 __Pyx_XDECREF(__pyx_t_4);
6352 __Pyx_XDECREF(__pyx_t_5);
6353 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6354 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6355 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6358 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
6359 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6360 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6361 __Pyx_XGIVEREF(__pyx_r);
6362 __Pyx_TraceReturn(__pyx_r, 0);
6363 __Pyx_RefNannyFinishContext();
6376 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A);
6377 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double[] =
"pycMatrix.set_csc_matrix_long_double(self, A)\n\n ";
6378 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double = {
"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double};
6379 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6380 PyObject *__pyx_r = 0;
6381 __Pyx_RefNannyDeclarations
6382 __Pyx_RefNannySetupContext(
"set_csc_matrix_long_double (wrapper)", 0);
6383 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6386 __Pyx_RefNannyFinishContext();
6390 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6391 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6392 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6393 __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6394 long double *__pyx_v_A_data_long_double;
6395 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6396 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6397 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
6398 __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
6399 PyObject *__pyx_r = NULL;
6400 __Pyx_TraceDeclarations
6401 __Pyx_RefNannyDeclarations
6402 PyObject *__pyx_t_1 = NULL;
6403 PyObject *__pyx_t_2 = NULL;
6404 __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6405 PyObject *__pyx_t_4 = NULL;
6406 PyObject *__pyx_t_5 = NULL;
6407 __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6408 Py_ssize_t __pyx_t_7;
6409 __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6411 int __pyx_lineno = 0;
6412 const char *__pyx_filename = NULL;
6413 int __pyx_clineno = 0;
6414 __Pyx_TraceFrameInit(__pyx_codeobj__13)
6415 __Pyx_RefNannySetupContext(
"set_csc_matrix_long_double", 0);
6416 __Pyx_TraceCall(
"set_csc_matrix_long_double", __pyx_f[0], 619, 0, __PYX_ERR(0, 619, __pyx_L1_error));
6425 __Pyx_TraceLine(624,0,__PYX_ERR(0, 624, __pyx_L1_error))
6426 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
6427 __Pyx_GOTREF(__pyx_t_1);
6428 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error)
6429 __Pyx_GOTREF(__pyx_t_2);
6430 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6431 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L1_error)
6432 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6433 __pyx_v_A_num_rows = __pyx_t_3;
6442 __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error))
6443 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error)
6444 __Pyx_GOTREF(__pyx_t_2);
6445 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error)
6446 __Pyx_GOTREF(__pyx_t_1);
6447 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6448 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1);
if (unlikely((__pyx_t_3 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L1_error)
6449 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6450 __pyx_v_A_num_columns = __pyx_t_3;
6459 __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
6460 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6461 __Pyx_GOTREF(__pyx_t_1);
6462 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
6463 __Pyx_GOTREF(__pyx_t_2);
6464 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6465 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6466 __Pyx_GOTREF(__pyx_t_1);
6467 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
6468 __Pyx_GOTREF(__pyx_t_4);
6469 __Pyx_GIVEREF(__pyx_t_1);
6470 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6472 __pyx_t_1 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6473 __Pyx_GOTREF(__pyx_t_1);
6474 if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 635, __pyx_L1_error)
6475 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error)
6476 __Pyx_GOTREF(__pyx_t_5);
6477 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6478 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6488 __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
6489 __Pyx_GIVEREF(__pyx_t_5);
6490 __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6491 __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6492 __pyx_v_self->A_indices_copy = __pyx_t_5;
6502 __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error))
6503 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6504 __Pyx_GOTREF(__pyx_t_5);
6505 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
6506 __Pyx_GOTREF(__pyx_t_1);
6507 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6508 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6509 __Pyx_GOTREF(__pyx_t_5);
6510 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error)
6511 __Pyx_GOTREF(__pyx_t_4);
6512 __Pyx_GIVEREF(__pyx_t_5);
6513 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6515 __pyx_t_5 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6516 __Pyx_GOTREF(__pyx_t_5);
6517 if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
6518 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
6519 __Pyx_GOTREF(__pyx_t_2);
6520 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6521 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6522 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6531 __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error))
6532 __Pyx_GIVEREF(__pyx_t_2);
6533 __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6534 __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6535 __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6545 __Pyx_TraceLine(640,0,__PYX_ERR(0, 640, __pyx_L1_error))
6546 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 640, __pyx_L1_error)
6547 __pyx_v_A_indices_mv = __pyx_t_6;
6548 __pyx_t_6.memview = NULL;
6549 __pyx_t_6.data = NULL;
6558 __Pyx_TraceLine(642,0,__PYX_ERR(0, 642, __pyx_L1_error))
6559 __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 642, __pyx_L1_error)
6560 __pyx_v_A_index_pointer_mv = __pyx_t_6;
6561 __pyx_t_6.memview = NULL;
6562 __pyx_t_6.data = NULL;
6571 __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error))
6573 __pyx_v_A_indices = (&(*((
int *) ( (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6582 __Pyx_TraceLine(646,0,__PYX_ERR(0, 646, __pyx_L1_error))
6584 __pyx_v_A_index_pointer = (&(*((
int *) ( (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6593 __Pyx_TraceLine(649,0,__PYX_ERR(0, 649, __pyx_L1_error))
6594 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
6595 __Pyx_GOTREF(__pyx_t_2);
6596 __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE);
if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 649, __pyx_L1_error)
6597 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6598 __pyx_v_A_data_long_double_mv = __pyx_t_8;
6599 __pyx_t_8.memview = NULL;
6600 __pyx_t_8.data = NULL;
6609 __Pyx_TraceLine(652,0,__PYX_ERR(0, 652, __pyx_L1_error))
6611 __pyx_v_A_data_long_double = (&(*((
long double *) ( (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
6620 __Pyx_TraceLine(655,0,__PYX_ERR(0, 655, __pyx_L1_error))
6622 __pyx_t_9 =
new cCSCMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6624 __Pyx_CppExn2PyErr();
6625 __PYX_ERR(0, 655, __pyx_L1_error)
6627 __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
6638 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6641 __Pyx_XDECREF(__pyx_t_1);
6642 __Pyx_XDECREF(__pyx_t_2);
6643 __Pyx_XDECREF(__pyx_t_4);
6644 __Pyx_XDECREF(__pyx_t_5);
6645 __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6646 __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6647 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6650 __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
6651 __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6652 __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6653 __Pyx_XGIVEREF(__pyx_r);
6654 __Pyx_TraceReturn(__pyx_r, 0);
6655 __Pyx_RefNannyFinishContext();
6666 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
6667 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__[] =
"pycMatrix.__reduce_cython__(self)";
6668 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__};
6669 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6670 PyObject *__pyx_r = 0;
6671 __Pyx_RefNannyDeclarations
6672 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
6673 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self));
6676 __Pyx_RefNannyFinishContext();
6680 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self) {
6681 PyObject *__pyx_r = NULL;
6682 __Pyx_TraceDeclarations
6683 __Pyx_RefNannyDeclarations
6684 PyObject *__pyx_t_1 = NULL;
6685 int __pyx_lineno = 0;
6686 const char *__pyx_filename = NULL;
6687 int __pyx_clineno = 0;
6688 __Pyx_TraceFrameInit(__pyx_codeobj__14)
6689 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
6690 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6698 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
6699 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6700 __Pyx_GOTREF(__pyx_t_1);
6701 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6702 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6703 __PYX_ERR(1, 2, __pyx_L1_error)
6713 __Pyx_XDECREF(__pyx_t_1);
6714 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6716 __Pyx_XGIVEREF(__pyx_r);
6717 __Pyx_TraceReturn(__pyx_r, 0);
6718 __Pyx_RefNannyFinishContext();
6730 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
6731 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__[] =
"pycMatrix.__setstate_cython__(self, __pyx_state)";
6732 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__};
6733 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6734 PyObject *__pyx_r = 0;
6735 __Pyx_RefNannyDeclarations
6736 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
6737 __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6740 __Pyx_RefNannyFinishContext();
6744 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6745 PyObject *__pyx_r = NULL;
6746 __Pyx_TraceDeclarations
6747 __Pyx_RefNannyDeclarations
6748 PyObject *__pyx_t_1 = NULL;
6749 int __pyx_lineno = 0;
6750 const char *__pyx_filename = NULL;
6751 int __pyx_clineno = 0;
6752 __Pyx_TraceFrameInit(__pyx_codeobj__16)
6753 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
6754 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6761 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
6762 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6763 __Pyx_GOTREF(__pyx_t_1);
6764 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6765 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6766 __PYX_ERR(1, 4, __pyx_L1_error)
6777 __Pyx_XDECREF(__pyx_t_1);
6778 __Pyx_AddTraceback(
"imate._c_linear_operator.py_c_matrix.pycMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6780 __Pyx_XGIVEREF(__pyx_r);
6781 __Pyx_TraceReturn(__pyx_r, 0);
6782 __Pyx_RefNannyFinishContext();
6795 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6796 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6797 PyObject *__pyx_v_shape = 0;
6798 Py_ssize_t __pyx_v_itemsize;
6799 PyObject *__pyx_v_format = 0;
6800 PyObject *__pyx_v_mode = 0;
6801 int __pyx_v_allocate_buffer;
6802 int __pyx_lineno = 0;
6803 const char *__pyx_filename = NULL;
6804 int __pyx_clineno = 0;
6806 __Pyx_RefNannyDeclarations
6807 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
6809 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
6810 PyObject* values[5] = {0,0,0,0,0};
6811 values[3] = ((PyObject *)__pyx_n_s_c);
6812 if (unlikely(__pyx_kwds)) {
6814 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6816 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6818 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6820 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6822 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6824 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6827 default:
goto __pyx_L5_argtuple_error;
6829 kw_args = PyDict_Size(__pyx_kwds);
6832 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
6833 else goto __pyx_L5_argtuple_error;
6836 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
6838 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
6842 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
6844 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
6849 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
6850 if (value) { values[3] = value; kw_args--; }
6855 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
6856 if (value) { values[4] = value; kw_args--; }
6859 if (unlikely(kw_args > 0)) {
6860 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
6863 switch (PyTuple_GET_SIZE(__pyx_args)) {
6864 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6866 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6868 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6869 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6870 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6872 default:
goto __pyx_L5_argtuple_error;
6875 __pyx_v_shape = ((PyObject*)values[0]);
6876 __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]);
if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
6877 __pyx_v_format = values[2];
6878 __pyx_v_mode = values[3];
6880 __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]);
if (unlikely((__pyx_v_allocate_buffer == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
6890 __pyx_v_allocate_buffer = ((int)1);
6893 goto __pyx_L4_argument_unpacking_done;
6894 __pyx_L5_argtuple_error:;
6895 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
6897 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6898 __Pyx_RefNannyFinishContext();
6900 __pyx_L4_argument_unpacking_done:;
6901 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1,
"shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
6902 if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
6903 PyErr_Format(PyExc_TypeError,
"Argument '%.200s' must not be None",
"format"); __PYX_ERR(1, 122, __pyx_L1_error)
6905 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((
struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
6920 __Pyx_RefNannyFinishContext();
6924 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode,
int __pyx_v_allocate_buffer) {
6926 Py_ssize_t __pyx_v_i;
6927 Py_ssize_t __pyx_v_dim;
6928 PyObject **__pyx_v_p;
6931 __Pyx_TraceDeclarations
6932 __Pyx_RefNannyDeclarations
6933 Py_ssize_t __pyx_t_1;
6935 PyObject *__pyx_t_3 = NULL;
6937 PyObject *__pyx_t_5 = NULL;
6938 PyObject *__pyx_t_6 = NULL;
6941 Py_ssize_t __pyx_t_9;
6942 PyObject *__pyx_t_10 = NULL;
6943 Py_ssize_t __pyx_t_11;
6944 int __pyx_lineno = 0;
6945 const char *__pyx_filename = NULL;
6946 int __pyx_clineno = 0;
6947 __Pyx_RefNannySetupContext(
"__cinit__", 0);
6948 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
6949 __Pyx_INCREF(__pyx_v_format);
6958 __Pyx_TraceLine(129,0,__PYX_ERR(1, 129, __pyx_L1_error))
6959 if (unlikely(__pyx_v_shape == Py_None)) {
6960 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
6961 __PYX_ERR(1, 129, __pyx_L1_error)
6963 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape);
if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
6964 __pyx_v_self->ndim = ((int)__pyx_t_1);
6973 __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
6974 __pyx_v_self->itemsize = __pyx_v_itemsize;
6983 __Pyx_TraceLine(132,0,__PYX_ERR(1, 132, __pyx_L1_error))
6984 __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
6985 if (unlikely(__pyx_t_2)) {
6994 __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
6995 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
6996 __Pyx_GOTREF(__pyx_t_3);
6997 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6998 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6999 __PYX_ERR(1, 133, __pyx_L1_error)
7017 __Pyx_TraceLine(135,0,__PYX_ERR(1, 135, __pyx_L1_error))
7018 __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7019 if (unlikely(__pyx_t_2)) {
7028 __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
7029 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
7030 __Pyx_GOTREF(__pyx_t_3);
7031 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7032 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7033 __PYX_ERR(1, 136, __pyx_L1_error)
7051 __Pyx_TraceLine(138,0,__PYX_ERR(1, 138, __pyx_L1_error))
7052 __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7053 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7063 __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
7064 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
7065 __Pyx_GOTREF(__pyx_t_5);
7067 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7068 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7069 if (likely(__pyx_t_6)) {
7070 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
7071 __Pyx_INCREF(__pyx_t_6);
7072 __Pyx_INCREF(
function);
7073 __Pyx_DECREF_SET(__pyx_t_5,
function);
7076 __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
7077 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7078 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
7079 __Pyx_GOTREF(__pyx_t_3);
7080 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7081 __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7100 __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
7101 if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
7102 __pyx_t_3 = __pyx_v_format;
7103 __Pyx_INCREF(__pyx_t_3);
7104 __Pyx_GIVEREF(__pyx_t_3);
7105 __Pyx_GOTREF(__pyx_v_self->_format);
7106 __Pyx_DECREF(__pyx_v_self->_format);
7107 __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
7117 __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
7118 if (unlikely(__pyx_v_self->_format == Py_None)) {
7119 PyErr_SetString(PyExc_TypeError,
"expected bytes, NoneType found");
7120 __PYX_ERR(1, 141, __pyx_L1_error)
7122 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format);
if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
7123 __pyx_v_self->format = __pyx_t_7;
7132 __Pyx_TraceLine(144,0,__PYX_ERR(1, 144, __pyx_L1_error))
7133 __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((
sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
7142 __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
7143 __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
7152 __Pyx_TraceLine(147,0,__PYX_ERR(1, 147, __pyx_L1_error))
7153 __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
7154 if (unlikely(__pyx_t_4)) {
7163 __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
7164 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
7165 __Pyx_GOTREF(__pyx_t_3);
7166 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7167 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7168 __PYX_ERR(1, 148, __pyx_L1_error)
7186 __Pyx_TraceLine(151,0,__PYX_ERR(1, 151, __pyx_L1_error))
7188 __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
7190 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
7191 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7192 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++;
if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
7194 __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
7195 __Pyx_GOTREF(__pyx_t_5);
7197 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
7198 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7199 __pyx_v_dim = __pyx_t_9;
7200 __pyx_v_idx = __pyx_t_8;
7201 __pyx_t_8 = (__pyx_t_8 + 1);
7210 __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
7211 __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
7212 if (unlikely(__pyx_t_4)) {
7221 __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
7222 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
7223 __Pyx_GOTREF(__pyx_t_5);
7224 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
7225 __Pyx_GOTREF(__pyx_t_6);
7226 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
7227 __Pyx_GOTREF(__pyx_t_10);
7228 __Pyx_GIVEREF(__pyx_t_5);
7229 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
7230 __Pyx_GIVEREF(__pyx_t_6);
7231 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
7234 __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
7235 __Pyx_GOTREF(__pyx_t_6);
7236 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7237 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
7238 __Pyx_GOTREF(__pyx_t_10);
7239 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7240 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7241 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7242 __PYX_ERR(1, 153, __pyx_L1_error)
7260 __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
7261 (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
7270 __Pyx_TraceLine(151,0,__PYX_ERR(1, 151, __pyx_L1_error))
7272 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7281 __Pyx_TraceLine(157,0,__PYX_ERR(1, 157, __pyx_L1_error))
7282 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
7292 __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
7293 __pyx_v_order =
'F';
7302 __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
7303 __Pyx_INCREF(__pyx_n_u_fortran);
7304 __Pyx_GIVEREF(__pyx_n_u_fortran);
7305 __Pyx_GOTREF(__pyx_v_self->mode);
7306 __Pyx_DECREF(__pyx_v_self->mode);
7307 __pyx_v_self->mode = __pyx_n_u_fortran;
7326 __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
7327 __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ));
if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
7328 if (likely(__pyx_t_4)) {
7337 __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
7338 __pyx_v_order =
'C';
7347 __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
7348 __Pyx_INCREF(__pyx_n_u_c);
7349 __Pyx_GIVEREF(__pyx_n_u_c);
7350 __Pyx_GOTREF(__pyx_v_self->mode);
7351 __Pyx_DECREF(__pyx_v_self->mode);
7352 __pyx_v_self->mode = __pyx_n_u_c;
7371 __Pyx_TraceLine(164,0,__PYX_ERR(1, 164, __pyx_L1_error))
7373 __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
7374 __Pyx_GOTREF(__pyx_t_3);
7375 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
7376 __Pyx_GOTREF(__pyx_t_10);
7377 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7378 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7379 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7380 __PYX_ERR(1, 164, __pyx_L1_error)
7391 __Pyx_TraceLine(166,0,__PYX_ERR(1, 166, __pyx_L1_error))
7392 __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
7401 __Pyx_TraceLine(169,0,__PYX_ERR(1, 169, __pyx_L1_error))
7402 __pyx_v_self->free_data = __pyx_v_allocate_buffer;
7411 __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
7412 __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
7413 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
7414 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7415 __pyx_v_self->dtype_is_object = __pyx_t_4;
7424 __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
7425 __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
7435 __Pyx_TraceLine(174,0,__PYX_ERR(1, 174, __pyx_L1_error))
7436 __pyx_v_self->data = ((
char *)malloc(__pyx_v_self->len));
7445 __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
7446 __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
7447 if (unlikely(__pyx_t_4)) {
7456 __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
7457 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL);
if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
7458 __Pyx_GOTREF(__pyx_t_10);
7459 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7460 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7461 __PYX_ERR(1, 176, __pyx_L1_error)
7479 __Pyx_TraceLine(178,0,__PYX_ERR(1, 178, __pyx_L1_error))
7480 __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
7490 __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
7491 __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7500 __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
7501 if (unlikely(__pyx_v_itemsize == 0)) {
7502 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
7503 __PYX_ERR(1, 180, __pyx_L1_error)
7505 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7506 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
7507 __PYX_ERR(1, 180, __pyx_L1_error)
7509 __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
7510 __pyx_t_9 = __pyx_t_1;
7511 for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
7512 __pyx_v_i = __pyx_t_11;
7521 __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
7522 (__pyx_v_p[__pyx_v_i]) = Py_None;
7531 __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
7565 __Pyx_XDECREF(__pyx_t_3);
7566 __Pyx_XDECREF(__pyx_t_5);
7567 __Pyx_XDECREF(__pyx_t_6);
7568 __Pyx_XDECREF(__pyx_t_10);
7569 __Pyx_AddTraceback(
"View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7572 __Pyx_XDECREF(__pyx_v_format);
7573 __Pyx_TraceReturn(Py_None, 0);
7574 __Pyx_RefNannyFinishContext();
7587 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
7588 static CYTHON_UNUSED
int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7590 __Pyx_RefNannyDeclarations
7591 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
7592 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((
struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
7595 __Pyx_RefNannyFinishContext();
7599 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(
struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
7600 int __pyx_v_bufmode;
7602 __Pyx_TraceDeclarations
7603 __Pyx_RefNannyDeclarations
7606 PyObject *__pyx_t_3 = NULL;
7608 Py_ssize_t __pyx_t_5;
7610 Py_ssize_t *__pyx_t_7;
7611 int __pyx_lineno = 0;
7612 const char *__pyx_filename = NULL;
7613 int __pyx_clineno = 0;
7614 if (__pyx_v_info == NULL) {
7615 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
7618 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
7619 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7620 __Pyx_GIVEREF(__pyx_v_info->obj);
7621 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
7630 __Pyx_TraceLine(186,0,__PYX_ERR(1, 186, __pyx_L1_error))
7631 __pyx_v_bufmode = -1;
7640 __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
7641 __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ));
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
7642 __pyx_t_2 = (__pyx_t_1 != 0);
7652 __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
7653 __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7672 __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
7673 __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ));
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
7674 __pyx_t_1 = (__pyx_t_2 != 0);
7684 __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
7685 __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7704 __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
7705 __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
7706 if (unlikely(__pyx_t_1)) {
7715 __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
7716 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
7717 __Pyx_GOTREF(__pyx_t_3);
7718 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7719 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7720 __PYX_ERR(1, 192, __pyx_L1_error)
7738 __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
7739 __pyx_t_4 = __pyx_v_self->data;
7740 __pyx_v_info->buf = __pyx_t_4;
7749 __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
7750 __pyx_t_5 = __pyx_v_self->len;
7751 __pyx_v_info->len = __pyx_t_5;
7760 __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
7761 __pyx_t_6 = __pyx_v_self->ndim;
7762 __pyx_v_info->ndim = __pyx_t_6;
7771 __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
7772 __pyx_t_7 = __pyx_v_self->_shape;
7773 __pyx_v_info->shape = __pyx_t_7;
7782 __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
7783 __pyx_t_7 = __pyx_v_self->_strides;
7784 __pyx_v_info->strides = __pyx_t_7;
7793 __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
7794 __pyx_v_info->suboffsets = NULL;
7803 __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
7804 __pyx_t_5 = __pyx_v_self->itemsize;
7805 __pyx_v_info->itemsize = __pyx_t_5;
7814 __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
7815 __pyx_v_info->readonly = 0;
7824 __Pyx_TraceLine(202,0,__PYX_ERR(1, 202, __pyx_L1_error))
7825 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7835 __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
7836 __pyx_t_4 = __pyx_v_self->format;
7837 __pyx_v_info->format = __pyx_t_4;
7856 __Pyx_TraceLine(205,0,__PYX_ERR(1, 205, __pyx_L1_error))
7858 __pyx_v_info->format = NULL;
7869 __Pyx_TraceLine(207,0,__PYX_ERR(1, 207, __pyx_L1_error))
7870 __Pyx_INCREF(((PyObject *)__pyx_v_self));
7871 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7872 __Pyx_GOTREF(__pyx_v_info->obj);
7873 __Pyx_DECREF(__pyx_v_info->obj);
7874 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7888 __Pyx_XDECREF(__pyx_t_3);
7889 __Pyx_AddTraceback(
"View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7891 if (__pyx_v_info->obj != NULL) {
7892 __Pyx_GOTREF(__pyx_v_info->obj);
7893 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7897 if (__pyx_v_info->obj == Py_None) {
7898 __Pyx_GOTREF(__pyx_v_info->obj);
7899 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7902 __Pyx_TraceReturn(Py_None, 0);
7903 __Pyx_RefNannyFinishContext();
7916 static void __pyx_array___dealloc__(PyObject *__pyx_v_self);
7917 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
7918 __Pyx_RefNannyDeclarations
7919 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
7920 __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((
struct __pyx_array_obj *)__pyx_v_self));
7923 __Pyx_RefNannyFinishContext();
7926 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(
struct __pyx_array_obj *__pyx_v_self) {
7927 __Pyx_TraceDeclarations
7928 __Pyx_RefNannyDeclarations
7930 int __pyx_lineno = 0;
7931 const char *__pyx_filename = NULL;
7932 int __pyx_clineno = 0;
7933 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
7934 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
7943 __Pyx_TraceLine(212,0,__PYX_ERR(1, 212, __pyx_L1_error))
7944 __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
7954 __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
7955 __pyx_v_self->callback_free_data(__pyx_v_self->data);
7974 __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
7975 __pyx_t_1 = (__pyx_v_self->free_data != 0);
7985 __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
7986 __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
7996 __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
7997 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8015 __Pyx_TraceLine(218,0,__PYX_ERR(1, 218, __pyx_L1_error))
8016 free(__pyx_v_self->data);
8035 __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
8036 PyObject_Free(__pyx_v_self->_shape);
8049 __Pyx_WriteUnraisable(
"View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8051 __Pyx_TraceReturn(Py_None, 0);
8052 __Pyx_RefNannyFinishContext();
8064 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self);
8065 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8066 PyObject *__pyx_r = 0;
8067 __Pyx_RefNannyDeclarations
8068 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
8069 __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((
struct __pyx_array_obj *)__pyx_v_self));
8072 __Pyx_RefNannyFinishContext();
8076 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(
struct __pyx_array_obj *__pyx_v_self) {
8077 PyObject *__pyx_r = NULL;
8078 __Pyx_TraceDeclarations
8079 __Pyx_RefNannyDeclarations
8080 PyObject *__pyx_t_1 = NULL;
8081 int __pyx_lineno = 0;
8082 const char *__pyx_filename = NULL;
8083 int __pyx_clineno = 0;
8084 __Pyx_RefNannySetupContext(
"__get__", 0);
8085 __Pyx_TraceCall(
"__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
8094 __Pyx_TraceLine(223,0,__PYX_ERR(1, 223, __pyx_L1_error))
8095 __Pyx_XDECREF(__pyx_r);
8096 __pyx_t_1 = ((
struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
8097 __Pyx_GOTREF(__pyx_t_1);
8098 __pyx_r = __pyx_t_1;
8112 __Pyx_XDECREF(__pyx_t_1);
8113 __Pyx_AddTraceback(
"View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8116 __Pyx_XGIVEREF(__pyx_r);
8117 __Pyx_TraceReturn(__pyx_r, 0);
8118 __Pyx_RefNannyFinishContext();
8130 static PyObject *__pyx_array_get_memview(
struct __pyx_array_obj *__pyx_v_self) {
8132 PyObject *__pyx_r = NULL;
8133 __Pyx_TraceDeclarations
8134 __Pyx_RefNannyDeclarations
8135 PyObject *__pyx_t_1 = NULL;
8136 PyObject *__pyx_t_2 = NULL;
8137 PyObject *__pyx_t_3 = NULL;
8138 int __pyx_lineno = 0;
8139 const char *__pyx_filename = NULL;
8140 int __pyx_clineno = 0;
8141 __Pyx_RefNannySetupContext(
"get_memview", 0);
8142 __Pyx_TraceCall(
"get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
8151 __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
8152 __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8161 __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
8162 __Pyx_XDECREF(__pyx_r);
8163 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
8164 __Pyx_GOTREF(__pyx_t_1);
8165 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8166 __Pyx_GOTREF(__pyx_t_2);
8167 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
8168 __Pyx_GOTREF(__pyx_t_3);
8169 __Pyx_INCREF(((PyObject *)__pyx_v_self));
8170 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8171 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8172 __Pyx_GIVEREF(__pyx_t_1);
8173 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
8174 __Pyx_GIVEREF(__pyx_t_2);
8175 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
8178 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8179 __Pyx_GOTREF(__pyx_t_2);
8180 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8181 __pyx_r = __pyx_t_2;
8195 __Pyx_XDECREF(__pyx_t_1);
8196 __Pyx_XDECREF(__pyx_t_2);
8197 __Pyx_XDECREF(__pyx_t_3);
8198 __Pyx_AddTraceback(
"View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
8201 __Pyx_XGIVEREF(__pyx_r);
8202 __Pyx_TraceReturn(__pyx_r, 0);
8203 __Pyx_RefNannyFinishContext();
8216 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self);
8217 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
8219 __Pyx_RefNannyDeclarations
8220 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
8221 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((
struct __pyx_array_obj *)__pyx_v_self));
8224 __Pyx_RefNannyFinishContext();
8228 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(
struct __pyx_array_obj *__pyx_v_self) {
8230 __Pyx_TraceDeclarations
8231 __Pyx_RefNannyDeclarations
8232 int __pyx_lineno = 0;
8233 const char *__pyx_filename = NULL;
8234 int __pyx_clineno = 0;
8235 __Pyx_RefNannySetupContext(
"__len__", 0);
8236 __Pyx_TraceCall(
"__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
8245 __Pyx_TraceLine(231,0,__PYX_ERR(1, 231, __pyx_L1_error))
8246 __pyx_r = (__pyx_v_self->_shape[0]);
8259 __Pyx_AddTraceback(
"View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8262 __Pyx_TraceReturn(Py_None, 0);
8263 __Pyx_RefNannyFinishContext();
8276 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr);
8277 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
8278 PyObject *__pyx_r = 0;
8279 __Pyx_RefNannyDeclarations
8280 __Pyx_RefNannySetupContext(
"__getattr__ (wrapper)", 0);
8281 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
8284 __Pyx_RefNannyFinishContext();
8288 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
8289 PyObject *__pyx_r = NULL;
8290 __Pyx_TraceDeclarations
8291 __Pyx_RefNannyDeclarations
8292 PyObject *__pyx_t_1 = NULL;
8293 PyObject *__pyx_t_2 = NULL;
8294 int __pyx_lineno = 0;
8295 const char *__pyx_filename = NULL;
8296 int __pyx_clineno = 0;
8297 __Pyx_RefNannySetupContext(
"__getattr__", 0);
8298 __Pyx_TraceCall(
"__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
8307 __Pyx_TraceLine(234,0,__PYX_ERR(1, 234, __pyx_L1_error))
8308 __Pyx_XDECREF(__pyx_r);
8309 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
8310 __Pyx_GOTREF(__pyx_t_1);
8311 __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
8312 __Pyx_GOTREF(__pyx_t_2);
8313 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8314 __pyx_r = __pyx_t_2;
8328 __Pyx_XDECREF(__pyx_t_1);
8329 __Pyx_XDECREF(__pyx_t_2);
8330 __Pyx_AddTraceback(
"View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8333 __Pyx_XGIVEREF(__pyx_r);
8334 __Pyx_TraceReturn(__pyx_r, 0);
8335 __Pyx_RefNannyFinishContext();
8348 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item);
8349 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
8350 PyObject *__pyx_r = 0;
8351 __Pyx_RefNannyDeclarations
8352 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
8353 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
8356 __Pyx_RefNannyFinishContext();
8360 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
8361 PyObject *__pyx_r = NULL;
8362 __Pyx_TraceDeclarations
8363 __Pyx_RefNannyDeclarations
8364 PyObject *__pyx_t_1 = NULL;
8365 PyObject *__pyx_t_2 = NULL;
8366 int __pyx_lineno = 0;
8367 const char *__pyx_filename = NULL;
8368 int __pyx_clineno = 0;
8369 __Pyx_RefNannySetupContext(
"__getitem__", 0);
8370 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
8379 __Pyx_TraceLine(237,0,__PYX_ERR(1, 237, __pyx_L1_error))
8380 __Pyx_XDECREF(__pyx_r);
8381 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
8382 __Pyx_GOTREF(__pyx_t_1);
8383 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
8384 __Pyx_GOTREF(__pyx_t_2);
8385 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8386 __pyx_r = __pyx_t_2;
8400 __Pyx_XDECREF(__pyx_t_1);
8401 __Pyx_XDECREF(__pyx_t_2);
8402 __Pyx_AddTraceback(
"View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8405 __Pyx_XGIVEREF(__pyx_r);
8406 __Pyx_TraceReturn(__pyx_r, 0);
8407 __Pyx_RefNannyFinishContext();
8420 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value);
8421 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8423 __Pyx_RefNannyDeclarations
8424 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
8425 __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
8428 __Pyx_RefNannyFinishContext();
8432 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(
struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8434 __Pyx_TraceDeclarations
8435 __Pyx_RefNannyDeclarations
8436 PyObject *__pyx_t_1 = NULL;
8437 int __pyx_lineno = 0;
8438 const char *__pyx_filename = NULL;
8439 int __pyx_clineno = 0;
8440 __Pyx_RefNannySetupContext(
"__setitem__", 0);
8441 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
8450 __Pyx_TraceLine(240,0,__PYX_ERR(1, 240, __pyx_L1_error))
8451 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
8452 __Pyx_GOTREF(__pyx_t_1);
8453 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
8454 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8468 __Pyx_XDECREF(__pyx_t_1);
8469 __Pyx_AddTraceback(
"View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8472 __Pyx_TraceReturn(Py_None, 0);
8473 __Pyx_RefNannyFinishContext();
8484 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8485 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
8486 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8487 PyObject *__pyx_r = 0;
8488 __Pyx_RefNannyDeclarations
8489 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
8490 __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((
struct __pyx_array_obj *)__pyx_v_self));
8493 __Pyx_RefNannyFinishContext();
8497 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self) {
8498 PyObject *__pyx_r = NULL;
8499 __Pyx_TraceDeclarations
8500 __Pyx_RefNannyDeclarations
8501 PyObject *__pyx_t_1 = NULL;
8502 int __pyx_lineno = 0;
8503 const char *__pyx_filename = NULL;
8504 int __pyx_clineno = 0;
8505 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
8506 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8514 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
8515 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8516 __Pyx_GOTREF(__pyx_t_1);
8517 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8518 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8519 __PYX_ERR(1, 2, __pyx_L1_error)
8529 __Pyx_XDECREF(__pyx_t_1);
8530 __Pyx_AddTraceback(
"View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8532 __Pyx_XGIVEREF(__pyx_r);
8533 __Pyx_TraceReturn(__pyx_r, 0);
8534 __Pyx_RefNannyFinishContext();
8546 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
8547 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
8548 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8549 PyObject *__pyx_r = 0;
8550 __Pyx_RefNannyDeclarations
8551 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
8552 __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((
struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8555 __Pyx_RefNannyFinishContext();
8559 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8560 PyObject *__pyx_r = NULL;
8561 __Pyx_TraceDeclarations
8562 __Pyx_RefNannyDeclarations
8563 PyObject *__pyx_t_1 = NULL;
8564 int __pyx_lineno = 0;
8565 const char *__pyx_filename = NULL;
8566 int __pyx_clineno = 0;
8567 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
8568 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
8575 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
8576 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8577 __Pyx_GOTREF(__pyx_t_1);
8578 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8579 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8580 __PYX_ERR(1, 4, __pyx_L1_error)
8591 __Pyx_XDECREF(__pyx_t_1);
8592 __Pyx_AddTraceback(
"View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8594 __Pyx_XGIVEREF(__pyx_r);
8595 __Pyx_TraceReturn(__pyx_r, 0);
8596 __Pyx_RefNannyFinishContext();
8608 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize,
char *__pyx_v_format,
char *__pyx_v_mode,
char *__pyx_v_buf) {
8609 struct __pyx_array_obj *__pyx_v_result = 0;
8610 struct __pyx_array_obj *__pyx_r = NULL;
8611 __Pyx_TraceDeclarations
8612 __Pyx_RefNannyDeclarations
8614 PyObject *__pyx_t_2 = NULL;
8615 PyObject *__pyx_t_3 = NULL;
8616 PyObject *__pyx_t_4 = NULL;
8617 PyObject *__pyx_t_5 = NULL;
8618 int __pyx_lineno = 0;
8619 const char *__pyx_filename = NULL;
8620 int __pyx_clineno = 0;
8621 __Pyx_RefNannySetupContext(
"array_cwrapper", 0);
8622 __Pyx_TraceCall(
"array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
8631 __Pyx_TraceLine(248,0,__PYX_ERR(1, 248, __pyx_L1_error))
8632 __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
8642 __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
8643 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
8644 __Pyx_GOTREF(__pyx_t_2);
8645 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
8646 __Pyx_GOTREF(__pyx_t_3);
8647 __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
8648 __Pyx_GOTREF(__pyx_t_4);
8649 __pyx_t_5 = PyTuple_New(4);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
8650 __Pyx_GOTREF(__pyx_t_5);
8651 __Pyx_INCREF(__pyx_v_shape);
8652 __Pyx_GIVEREF(__pyx_v_shape);
8653 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8654 __Pyx_GIVEREF(__pyx_t_2);
8655 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8656 __Pyx_GIVEREF(__pyx_t_3);
8657 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8658 __Pyx_GIVEREF(__pyx_t_4);
8659 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8663 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
8664 __Pyx_GOTREF(__pyx_t_4);
8665 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8666 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_4);
8686 __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error))
8688 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
8689 __Pyx_GOTREF(__pyx_t_4);
8690 __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
8691 __Pyx_GOTREF(__pyx_t_5);
8692 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
8693 __Pyx_GOTREF(__pyx_t_3);
8694 __pyx_t_2 = PyTuple_New(4);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
8695 __Pyx_GOTREF(__pyx_t_2);
8696 __Pyx_INCREF(__pyx_v_shape);
8697 __Pyx_GIVEREF(__pyx_v_shape);
8698 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
8699 __Pyx_GIVEREF(__pyx_t_4);
8700 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
8701 __Pyx_GIVEREF(__pyx_t_5);
8702 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8703 __Pyx_GIVEREF(__pyx_t_3);
8704 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
8716 __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8717 __pyx_t_3 = __Pyx_PyDict_NewPresized(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
8718 __Pyx_GOTREF(__pyx_t_3);
8719 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
8728 __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error))
8729 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
8730 __Pyx_GOTREF(__pyx_t_5);
8731 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8732 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8733 __pyx_v_result = ((
struct __pyx_array_obj *)__pyx_t_5);
8743 __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
8744 __pyx_v_result->data = __pyx_v_buf;
8755 __Pyx_TraceLine(255,0,__PYX_ERR(1, 255, __pyx_L1_error))
8756 __Pyx_XDECREF(((PyObject *)__pyx_r));
8757 __Pyx_INCREF(((PyObject *)__pyx_v_result));
8758 __pyx_r = __pyx_v_result;
8771 __Pyx_XDECREF(__pyx_t_2);
8772 __Pyx_XDECREF(__pyx_t_3);
8773 __Pyx_XDECREF(__pyx_t_4);
8774 __Pyx_XDECREF(__pyx_t_5);
8775 __Pyx_AddTraceback(
"View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8778 __Pyx_XDECREF((PyObject *)__pyx_v_result);
8779 __Pyx_XGIVEREF((PyObject *)__pyx_r);
8780 __Pyx_TraceReturn(__pyx_r, 0);
8781 __Pyx_RefNannyFinishContext();
8794 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8795 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8796 PyObject *__pyx_v_name = 0;
8797 int __pyx_lineno = 0;
8798 const char *__pyx_filename = NULL;
8799 int __pyx_clineno = 0;
8801 __Pyx_RefNannyDeclarations
8802 __Pyx_RefNannySetupContext(
"__init__ (wrapper)", 0);
8804 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
8805 PyObject* values[1] = {0};
8806 if (unlikely(__pyx_kwds)) {
8808 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8810 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8813 default:
goto __pyx_L5_argtuple_error;
8815 kw_args = PyDict_Size(__pyx_kwds);
8818 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
8819 else goto __pyx_L5_argtuple_error;
8821 if (unlikely(kw_args > 0)) {
8822 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
8824 }
else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
8825 goto __pyx_L5_argtuple_error;
8827 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8829 __pyx_v_name = values[0];
8831 goto __pyx_L4_argument_unpacking_done;
8832 __pyx_L5_argtuple_error:;
8833 __Pyx_RaiseArgtupleInvalid(
"__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
8835 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8836 __Pyx_RefNannyFinishContext();
8838 __pyx_L4_argument_unpacking_done:;
8839 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
8842 __Pyx_RefNannyFinishContext();
8846 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
8848 __Pyx_TraceDeclarations
8849 __Pyx_RefNannyDeclarations
8850 int __pyx_lineno = 0;
8851 const char *__pyx_filename = NULL;
8852 int __pyx_clineno = 0;
8853 __Pyx_RefNannySetupContext(
"__init__", 0);
8854 __Pyx_TraceCall(
"__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
8863 __Pyx_TraceLine(282,0,__PYX_ERR(1, 282, __pyx_L1_error))
8864 __Pyx_INCREF(__pyx_v_name);
8865 __Pyx_GIVEREF(__pyx_v_name);
8866 __Pyx_GOTREF(__pyx_v_self->name);
8867 __Pyx_DECREF(__pyx_v_self->name);
8868 __pyx_v_self->name = __pyx_v_name;
8882 __Pyx_AddTraceback(
"View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8885 __Pyx_TraceReturn(Py_None, 0);
8886 __Pyx_RefNannyFinishContext();
8899 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self);
8900 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
8901 PyObject *__pyx_r = 0;
8902 __Pyx_RefNannyDeclarations
8903 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
8904 __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8907 __Pyx_RefNannyFinishContext();
8911 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8912 PyObject *__pyx_r = NULL;
8913 __Pyx_TraceDeclarations
8914 __Pyx_RefNannyDeclarations
8915 int __pyx_lineno = 0;
8916 const char *__pyx_filename = NULL;
8917 int __pyx_clineno = 0;
8918 __Pyx_RefNannySetupContext(
"__repr__", 0);
8919 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
8928 __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error))
8929 __Pyx_XDECREF(__pyx_r);
8930 __Pyx_INCREF(__pyx_v_self->name);
8931 __pyx_r = __pyx_v_self->name;
8944 __Pyx_AddTraceback(
"View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8947 __Pyx_XGIVEREF(__pyx_r);
8948 __Pyx_TraceReturn(__pyx_r, 0);
8949 __Pyx_RefNannyFinishContext();
8960 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
8961 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
8962 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8963 PyObject *__pyx_r = 0;
8964 __Pyx_RefNannyDeclarations
8965 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
8966 __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8969 __Pyx_RefNannyFinishContext();
8973 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8974 PyObject *__pyx_v_state = 0;
8975 PyObject *__pyx_v__dict = 0;
8976 int __pyx_v_use_setstate;
8977 PyObject *__pyx_r = NULL;
8978 __Pyx_TraceDeclarations
8979 __Pyx_RefNannyDeclarations
8980 PyObject *__pyx_t_1 = NULL;
8983 PyObject *__pyx_t_4 = NULL;
8984 PyObject *__pyx_t_5 = NULL;
8985 int __pyx_lineno = 0;
8986 const char *__pyx_filename = NULL;
8987 int __pyx_clineno = 0;
8988 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
8989 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8998 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
8999 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9000 __Pyx_GOTREF(__pyx_t_1);
9001 __Pyx_INCREF(__pyx_v_self->name);
9002 __Pyx_GIVEREF(__pyx_v_self->name);
9003 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9004 __pyx_v_state = ((PyObject*)__pyx_t_1);
9014 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
9015 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9016 __Pyx_GOTREF(__pyx_t_1);
9017 __pyx_v__dict = __pyx_t_1;
9027 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
9028 __pyx_t_2 = (__pyx_v__dict != Py_None);
9029 __pyx_t_3 = (__pyx_t_2 != 0);
9039 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
9040 __pyx_t_1 = PyTuple_New(1);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9041 __Pyx_GOTREF(__pyx_t_1);
9042 __Pyx_INCREF(__pyx_v__dict);
9043 __Pyx_GIVEREF(__pyx_v__dict);
9044 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9045 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9046 __Pyx_GOTREF(__pyx_t_4);
9047 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9048 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9058 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
9059 __pyx_v_use_setstate = 1;
9078 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
9080 __pyx_t_3 = (__pyx_v_self->name != Py_None);
9081 __pyx_v_use_setstate = __pyx_t_3;
9092 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
9093 __pyx_t_3 = (__pyx_v_use_setstate != 0);
9103 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
9104 __Pyx_XDECREF(__pyx_r);
9105 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9106 __Pyx_GOTREF(__pyx_t_4);
9107 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
9108 __Pyx_GOTREF(__pyx_t_1);
9109 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9110 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9111 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9112 __Pyx_INCREF(__pyx_int_184977713);
9113 __Pyx_GIVEREF(__pyx_int_184977713);
9114 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9115 __Pyx_INCREF(Py_None);
9116 __Pyx_GIVEREF(Py_None);
9117 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9118 __pyx_t_5 = PyTuple_New(3);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9119 __Pyx_GOTREF(__pyx_t_5);
9120 __Pyx_GIVEREF(__pyx_t_4);
9121 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9122 __Pyx_GIVEREF(__pyx_t_1);
9123 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9124 __Pyx_INCREF(__pyx_v_state);
9125 __Pyx_GIVEREF(__pyx_v_state);
9126 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9129 __pyx_r = __pyx_t_5;
9149 __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
9151 __Pyx_XDECREF(__pyx_r);
9152 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9153 __Pyx_GOTREF(__pyx_t_5);
9154 __pyx_t_1 = PyTuple_New(3);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
9155 __Pyx_GOTREF(__pyx_t_1);
9156 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9157 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9158 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9159 __Pyx_INCREF(__pyx_int_184977713);
9160 __Pyx_GIVEREF(__pyx_int_184977713);
9161 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9162 __Pyx_INCREF(__pyx_v_state);
9163 __Pyx_GIVEREF(__pyx_v_state);
9164 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9165 __pyx_t_4 = PyTuple_New(2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9166 __Pyx_GOTREF(__pyx_t_4);
9167 __Pyx_GIVEREF(__pyx_t_5);
9168 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9169 __Pyx_GIVEREF(__pyx_t_1);
9170 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9173 __pyx_r = __pyx_t_4;
9186 __Pyx_XDECREF(__pyx_t_1);
9187 __Pyx_XDECREF(__pyx_t_4);
9188 __Pyx_XDECREF(__pyx_t_5);
9189 __Pyx_AddTraceback(
"View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9192 __Pyx_XDECREF(__pyx_v_state);
9193 __Pyx_XDECREF(__pyx_v__dict);
9194 __Pyx_XGIVEREF(__pyx_r);
9195 __Pyx_TraceReturn(__pyx_r, 0);
9196 __Pyx_RefNannyFinishContext();
9208 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
9209 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
9210 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9211 PyObject *__pyx_r = 0;
9212 __Pyx_RefNannyDeclarations
9213 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
9214 __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((
struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9217 __Pyx_RefNannyFinishContext();
9221 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(
struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9222 PyObject *__pyx_r = NULL;
9223 __Pyx_TraceDeclarations
9224 __Pyx_RefNannyDeclarations
9225 PyObject *__pyx_t_1 = NULL;
9226 int __pyx_lineno = 0;
9227 const char *__pyx_filename = NULL;
9228 int __pyx_clineno = 0;
9229 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
9230 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
9237 __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
9238 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9239 __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9240 __Pyx_GOTREF(__pyx_t_1);
9241 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9251 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9254 __Pyx_XDECREF(__pyx_t_1);
9255 __Pyx_AddTraceback(
"View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9258 __Pyx_XGIVEREF(__pyx_r);
9259 __Pyx_TraceReturn(__pyx_r, 0);
9260 __Pyx_RefNannyFinishContext();
9272 static void *__pyx_align_pointer(
void *__pyx_v_memory,
size_t __pyx_v_alignment) {
9273 Py_intptr_t __pyx_v_aligned_p;
9274 size_t __pyx_v_offset;
9276 __Pyx_TraceDeclarations
9278 int __pyx_lineno = 0;
9279 const char *__pyx_filename = NULL;
9280 int __pyx_clineno = 0;
9281 __Pyx_TraceCall(
"align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
9290 __Pyx_TraceLine(300,1,__PYX_ERR(1, 300, __pyx_L1_error))
9291 __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
9300 __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
9309 __Pyx_TraceLine(306,1,__PYX_ERR(1, 306, __pyx_L1_error))
9310 __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
9320 __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
9321 __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
9339 __Pyx_TraceLine(309,1,__PYX_ERR(1, 309, __pyx_L1_error))
9340 __pyx_r = ((
void *)__pyx_v_aligned_p);
9353 __Pyx_WriteUnraisable(
"View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
9356 __Pyx_TraceReturn(Py_None, 1);
9369 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
9370 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9371 PyObject *__pyx_v_obj = 0;
9373 int __pyx_v_dtype_is_object;
9374 int __pyx_lineno = 0;
9375 const char *__pyx_filename = NULL;
9376 int __pyx_clineno = 0;
9378 __Pyx_RefNannyDeclarations
9379 __Pyx_RefNannySetupContext(
"__cinit__ (wrapper)", 0);
9381 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
9382 PyObject* values[3] = {0,0,0};
9383 if (unlikely(__pyx_kwds)) {
9385 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9387 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9389 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9391 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9394 default:
goto __pyx_L5_argtuple_error;
9396 kw_args = PyDict_Size(__pyx_kwds);
9399 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
9400 else goto __pyx_L5_argtuple_error;
9403 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
9405 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
9410 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
9411 if (value) { values[2] = value; kw_args--; }
9414 if (unlikely(kw_args > 0)) {
9415 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
9418 switch (PyTuple_GET_SIZE(__pyx_args)) {
9419 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9421 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9422 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9424 default:
goto __pyx_L5_argtuple_error;
9427 __pyx_v_obj = values[0];
9428 __pyx_v_flags = __Pyx_PyInt_As_int(values[1]);
if (unlikely((__pyx_v_flags == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
9430 __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]);
if (unlikely((__pyx_v_dtype_is_object == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
9432 __pyx_v_dtype_is_object = ((int)0);
9435 goto __pyx_L4_argument_unpacking_done;
9436 __pyx_L5_argtuple_error:;
9437 __Pyx_RaiseArgtupleInvalid(
"__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
9439 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9440 __Pyx_RefNannyFinishContext();
9442 __pyx_L4_argument_unpacking_done:;
9443 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
9446 __Pyx_RefNannyFinishContext();
9450 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj,
int __pyx_v_flags,
int __pyx_v_dtype_is_object) {
9452 __Pyx_TraceDeclarations
9453 __Pyx_RefNannyDeclarations
9458 int __pyx_lineno = 0;
9459 const char *__pyx_filename = NULL;
9460 int __pyx_clineno = 0;
9461 __Pyx_RefNannySetupContext(
"__cinit__", 0);
9462 __Pyx_TraceCall(
"__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
9471 __Pyx_TraceLine(346,0,__PYX_ERR(1, 346, __pyx_L1_error))
9472 __Pyx_INCREF(__pyx_v_obj);
9473 __Pyx_GIVEREF(__pyx_v_obj);
9474 __Pyx_GOTREF(__pyx_v_self->obj);
9475 __Pyx_DECREF(__pyx_v_self->obj);
9476 __pyx_v_self->obj = __pyx_v_obj;
9485 __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
9486 __pyx_v_self->flags = __pyx_v_flags;
9495 __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
9496 __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9497 __pyx_t_3 = (__pyx_t_2 != 0);
9500 __pyx_t_1 = __pyx_t_3;
9501 goto __pyx_L4_bool_binop_done;
9503 __pyx_t_3 = (__pyx_v_obj != Py_None);
9504 __pyx_t_2 = (__pyx_t_3 != 0);
9505 __pyx_t_1 = __pyx_t_2;
9506 __pyx_L4_bool_binop_done:;
9516 __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
9517 __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
9526 __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
9527 __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
9537 __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
9538 ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9547 __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
9575 __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
9576 __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
9586 __Pyx_TraceLine(356,0,__PYX_ERR(1, 356, __pyx_L1_error))
9587 __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9596 __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
9597 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9615 __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
9616 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9626 __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
9627 __pyx_v_self->lock = PyThread_allocate_lock();
9636 __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
9637 __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9638 if (unlikely(__pyx_t_1)) {
9647 __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
9648 PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
9675 __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
9676 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9686 __Pyx_TraceLine(364,0,__PYX_ERR(1, 364, __pyx_L1_error))
9687 __pyx_t_2 = (((__pyx_v_self->view.format[0]) ==
'O') != 0);
9690 __pyx_t_1 = __pyx_t_2;
9691 goto __pyx_L11_bool_binop_done;
9693 __pyx_t_2 = (((__pyx_v_self->view.format[1]) ==
'\x00') != 0);
9694 __pyx_t_1 = __pyx_t_2;
9695 __pyx_L11_bool_binop_done:;
9696 __pyx_v_self->dtype_is_object = __pyx_t_1;
9715 __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
9717 __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
9728 __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
9729 __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((
void *)(&(__pyx_v_self->acquisition_count[0]))), (
sizeof(__pyx_atomic_int))));
9738 __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
9739 __pyx_v_self->typeinfo = NULL;
9753 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9756 __Pyx_TraceReturn(Py_None, 0);
9757 __Pyx_RefNannyFinishContext();
9770 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self);
9771 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
9772 __Pyx_RefNannyDeclarations
9773 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
9774 __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
9777 __Pyx_RefNannyFinishContext();
9780 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(
struct __pyx_memoryview_obj *__pyx_v_self) {
9782 __Pyx_TraceDeclarations
9783 __Pyx_RefNannyDeclarations
9789 PyThread_type_lock __pyx_t_6;
9790 PyThread_type_lock __pyx_t_7;
9791 int __pyx_lineno = 0;
9792 const char *__pyx_filename = NULL;
9793 int __pyx_clineno = 0;
9794 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
9795 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
9804 __Pyx_TraceLine(373,0,__PYX_ERR(1, 373, __pyx_L1_error))
9805 __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9806 __pyx_t_2 = (__pyx_t_1 != 0);
9816 __Pyx_TraceLine(374,0,__PYX_ERR(1, 374, __pyx_L1_error))
9817 __Pyx_ReleaseBuffer((&__pyx_v_self->view));
9836 __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
9837 __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
9847 __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
9848 ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
9857 __Pyx_TraceLine(378,0,__PYX_ERR(1, 378, __pyx_L1_error))
9877 __Pyx_TraceLine(382,0,__PYX_ERR(1, 382, __pyx_L1_error))
9878 __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
9888 __Pyx_TraceLine(383,0,__PYX_ERR(1, 383, __pyx_L1_error))
9889 __pyx_t_3 = __pyx_memoryview_thread_locks_used;
9890 __pyx_t_4 = __pyx_t_3;
9891 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
9892 __pyx_v_i = __pyx_t_5;
9901 __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
9902 __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
9912 __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
9913 __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
9922 __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
9923 __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
9933 __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
9934 __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9935 __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
9944 __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
9945 (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
9946 (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
9964 __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
9965 goto __pyx_L6_break;
9985 __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
9986 PyThread_free_lock(__pyx_v_self->lock);
10010 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10012 __Pyx_TraceReturn(Py_None, 0);
10013 __Pyx_RefNannyFinishContext();
10024 static char *__pyx_memoryview_get_item_pointer(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10025 Py_ssize_t __pyx_v_dim;
10026 char *__pyx_v_itemp;
10027 PyObject *__pyx_v_idx = NULL;
10029 __Pyx_TraceDeclarations
10030 __Pyx_RefNannyDeclarations
10031 Py_ssize_t __pyx_t_1;
10032 PyObject *__pyx_t_2 = NULL;
10033 Py_ssize_t __pyx_t_3;
10034 PyObject *(*__pyx_t_4)(PyObject *);
10035 PyObject *__pyx_t_5 = NULL;
10036 Py_ssize_t __pyx_t_6;
10038 int __pyx_lineno = 0;
10039 const char *__pyx_filename = NULL;
10040 int __pyx_clineno = 0;
10041 __Pyx_RefNannySetupContext(
"get_item_pointer", 0);
10042 __Pyx_TraceCall(
"get_item_pointer", __pyx_f[1], 393, 0, __PYX_ERR(1, 393, __pyx_L1_error));
10051 __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
10052 __pyx_v_itemp = ((
char *)__pyx_v_self->view.buf);
10061 __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
10063 if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10064 __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10067 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
10068 __Pyx_GOTREF(__pyx_t_2);
10069 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
10072 if (likely(!__pyx_t_4)) {
10073 if (likely(PyList_CheckExact(__pyx_t_2))) {
10074 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2))
break;
10075 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10076 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10078 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10079 __Pyx_GOTREF(__pyx_t_5);
10082 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2))
break;
10083 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10084 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10086 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10087 __Pyx_GOTREF(__pyx_t_5);
10091 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10092 if (unlikely(!__pyx_t_5)) {
10093 PyObject* exc_type = PyErr_Occurred();
10095 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10096 else __PYX_ERR(1, 397, __pyx_L1_error)
10100 __Pyx_GOTREF(__pyx_t_5);
10102 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10104 __pyx_v_dim = __pyx_t_1;
10105 __pyx_t_1 = (__pyx_t_1 + 1);
10114 __Pyx_TraceLine(398,0,__PYX_ERR(1, 398, __pyx_L1_error))
10115 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx);
if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
10116 __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim);
if (unlikely(__pyx_t_7 == ((
char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
10117 __pyx_v_itemp = __pyx_t_7;
10126 __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
10128 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10137 __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
10138 __pyx_r = __pyx_v_itemp;
10151 __Pyx_XDECREF(__pyx_t_2);
10152 __Pyx_XDECREF(__pyx_t_5);
10153 __Pyx_AddTraceback(
"View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10156 __Pyx_XDECREF(__pyx_v_idx);
10157 __Pyx_TraceReturn(Py_None, 0);
10158 __Pyx_RefNannyFinishContext();
10171 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index);
10172 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10173 PyObject *__pyx_r = 0;
10174 __Pyx_RefNannyDeclarations
10175 __Pyx_RefNannySetupContext(
"__getitem__ (wrapper)", 0);
10176 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10179 __Pyx_RefNannyFinishContext();
10183 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10184 PyObject *__pyx_v_have_slices = NULL;
10185 PyObject *__pyx_v_indices = NULL;
10186 char *__pyx_v_itemp;
10187 PyObject *__pyx_r = NULL;
10188 __Pyx_TraceDeclarations
10189 __Pyx_RefNannyDeclarations
10192 PyObject *__pyx_t_3 = NULL;
10193 PyObject *__pyx_t_4 = NULL;
10194 PyObject *__pyx_t_5 = NULL;
10196 int __pyx_lineno = 0;
10197 const char *__pyx_filename = NULL;
10198 int __pyx_clineno = 0;
10199 __Pyx_RefNannySetupContext(
"__getitem__", 0);
10200 __Pyx_TraceCall(
"__getitem__", __pyx_f[1], 403, 0, __PYX_ERR(1, 403, __pyx_L1_error));
10209 __Pyx_TraceLine(404,0,__PYX_ERR(1, 404, __pyx_L1_error))
10210 __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10211 __pyx_t_2 = (__pyx_t_1 != 0);
10221 __Pyx_TraceLine(405,0,__PYX_ERR(1, 405, __pyx_L1_error))
10222 __Pyx_XDECREF(__pyx_r);
10223 __Pyx_INCREF(((PyObject *)__pyx_v_self));
10224 __pyx_r = ((PyObject *)__pyx_v_self);
10243 __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
10244 __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
10245 __Pyx_GOTREF(__pyx_t_3);
10246 if (likely(__pyx_t_3 != Py_None)) {
10247 PyObject* sequence = __pyx_t_3;
10248 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10249 if (unlikely(size != 2)) {
10250 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10251 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10252 __PYX_ERR(1, 407, __pyx_L1_error)
10254 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10255 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10256 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10257 __Pyx_INCREF(__pyx_t_4);
10258 __Pyx_INCREF(__pyx_t_5);
10260 __pyx_t_4 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
10261 __Pyx_GOTREF(__pyx_t_4);
10262 __pyx_t_5 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
10263 __Pyx_GOTREF(__pyx_t_5);
10265 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10267 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
10269 __pyx_v_have_slices = __pyx_t_4;
10271 __pyx_v_indices = __pyx_t_5;
10281 __Pyx_TraceLine(410,0,__PYX_ERR(1, 410, __pyx_L1_error))
10282 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
10292 __Pyx_TraceLine(411,0,__PYX_ERR(1, 411, __pyx_L1_error))
10293 __Pyx_XDECREF(__pyx_r);
10294 __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
10295 __Pyx_GOTREF(__pyx_t_3);
10296 __pyx_r = __pyx_t_3;
10316 __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
10318 __pyx_t_6 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices);
if (unlikely(__pyx_t_6 == ((
char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
10319 __pyx_v_itemp = __pyx_t_6;
10328 __Pyx_TraceLine(414,0,__PYX_ERR(1, 414, __pyx_L1_error))
10329 __Pyx_XDECREF(__pyx_r);
10330 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
10331 __Pyx_GOTREF(__pyx_t_3);
10332 __pyx_r = __pyx_t_3;
10347 __Pyx_XDECREF(__pyx_t_3);
10348 __Pyx_XDECREF(__pyx_t_4);
10349 __Pyx_XDECREF(__pyx_t_5);
10350 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10353 __Pyx_XDECREF(__pyx_v_have_slices);
10354 __Pyx_XDECREF(__pyx_v_indices);
10355 __Pyx_XGIVEREF(__pyx_r);
10356 __Pyx_TraceReturn(__pyx_r, 0);
10357 __Pyx_RefNannyFinishContext();
10370 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value);
10371 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10373 __Pyx_RefNannyDeclarations
10374 __Pyx_RefNannySetupContext(
"__setitem__ (wrapper)", 0);
10375 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
10378 __Pyx_RefNannyFinishContext();
10382 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10383 PyObject *__pyx_v_have_slices = NULL;
10384 PyObject *__pyx_v_obj = NULL;
10386 __Pyx_TraceDeclarations
10387 __Pyx_RefNannyDeclarations
10389 PyObject *__pyx_t_2 = NULL;
10390 PyObject *__pyx_t_3 = NULL;
10391 PyObject *__pyx_t_4 = NULL;
10392 int __pyx_lineno = 0;
10393 const char *__pyx_filename = NULL;
10394 int __pyx_clineno = 0;
10395 __Pyx_RefNannySetupContext(
"__setitem__", 0);
10396 __Pyx_TraceCall(
"__setitem__", __pyx_f[1], 416, 0, __PYX_ERR(1, 416, __pyx_L1_error));
10397 __Pyx_INCREF(__pyx_v_index);
10406 __Pyx_TraceLine(417,0,__PYX_ERR(1, 417, __pyx_L1_error))
10407 __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
10408 if (unlikely(__pyx_t_1)) {
10417 __Pyx_TraceLine(418,0,__PYX_ERR(1, 418, __pyx_L1_error))
10418 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
10419 __Pyx_GOTREF(__pyx_t_2);
10420 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
10421 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10422 __PYX_ERR(1, 418, __pyx_L1_error)
10440 __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
10441 __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
10442 __Pyx_GOTREF(__pyx_t_2);
10443 if (likely(__pyx_t_2 != Py_None)) {
10444 PyObject* sequence = __pyx_t_2;
10445 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10446 if (unlikely(size != 2)) {
10447 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10448 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10449 __PYX_ERR(1, 420, __pyx_L1_error)
10451 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10452 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
10453 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
10454 __Pyx_INCREF(__pyx_t_3);
10455 __Pyx_INCREF(__pyx_t_4);
10457 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
10458 __Pyx_GOTREF(__pyx_t_3);
10459 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
10460 __Pyx_GOTREF(__pyx_t_4);
10462 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10464 __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
10466 __pyx_v_have_slices = __pyx_t_3;
10468 __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
10478 __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
10479 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
10489 __Pyx_TraceLine(423,0,__PYX_ERR(1, 423, __pyx_L1_error))
10490 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
10491 __Pyx_GOTREF(__pyx_t_2);
10492 __pyx_v_obj = __pyx_t_2;
10502 __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
10503 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
10513 __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
10514 __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
10515 __Pyx_GOTREF(__pyx_t_2);
10516 __pyx_t_4 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
10517 __Pyx_GOTREF(__pyx_t_4);
10518 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10519 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10538 __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
10540 __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
10541 __Pyx_GOTREF(__pyx_t_4);
10542 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
10543 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((
struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
10544 __Pyx_GOTREF(__pyx_t_2);
10545 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10546 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10567 __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
10569 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
10570 __Pyx_GOTREF(__pyx_t_2);
10571 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10587 __Pyx_XDECREF(__pyx_t_2);
10588 __Pyx_XDECREF(__pyx_t_3);
10589 __Pyx_XDECREF(__pyx_t_4);
10590 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10593 __Pyx_XDECREF(__pyx_v_have_slices);
10594 __Pyx_XDECREF(__pyx_v_obj);
10595 __Pyx_XDECREF(__pyx_v_index);
10596 __Pyx_TraceReturn(Py_None, 0);
10597 __Pyx_RefNannyFinishContext();
10609 static PyObject *__pyx_memoryview_is_slice(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
10610 PyObject *__pyx_r = NULL;
10611 __Pyx_TraceDeclarations
10612 __Pyx_RefNannyDeclarations
10615 PyObject *__pyx_t_3 = NULL;
10616 PyObject *__pyx_t_4 = NULL;
10617 PyObject *__pyx_t_5 = NULL;
10618 PyObject *__pyx_t_6 = NULL;
10619 PyObject *__pyx_t_7 = NULL;
10620 PyObject *__pyx_t_8 = NULL;
10622 int __pyx_lineno = 0;
10623 const char *__pyx_filename = NULL;
10624 int __pyx_clineno = 0;
10625 __Pyx_RefNannySetupContext(
"is_slice", 0);
10626 __Pyx_TraceCall(
"is_slice", __pyx_f[1], 431, 0, __PYX_ERR(1, 431, __pyx_L1_error));
10627 __Pyx_INCREF(__pyx_v_obj);
10636 __Pyx_TraceLine(432,0,__PYX_ERR(1, 432, __pyx_L1_error))
10637 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10638 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
10648 __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
10650 __Pyx_PyThreadState_declare
10651 __Pyx_PyThreadState_assign
10652 __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10653 __Pyx_XGOTREF(__pyx_t_3);
10654 __Pyx_XGOTREF(__pyx_t_4);
10655 __Pyx_XGOTREF(__pyx_t_5);
10665 __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L4_error))
10666 __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
10667 __Pyx_GOTREF(__pyx_t_6);
10676 __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L4_error))
10677 __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
10678 __Pyx_GOTREF(__pyx_t_7);
10687 __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L4_error))
10688 __pyx_t_8 = PyTuple_New(3);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
10689 __Pyx_GOTREF(__pyx_t_8);
10690 __Pyx_INCREF(__pyx_v_obj);
10691 __Pyx_GIVEREF(__pyx_v_obj);
10692 PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
10693 __Pyx_GIVEREF(__pyx_t_6);
10694 PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
10695 __Pyx_GIVEREF(__pyx_t_7);
10696 PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
10699 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
10700 __Pyx_GOTREF(__pyx_t_7);
10701 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10702 __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
10713 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10714 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10715 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10716 goto __pyx_L9_try_end;
10718 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10719 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10720 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10729 __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L6_except_error))
10730 __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10732 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10733 if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
10734 __Pyx_GOTREF(__pyx_t_7);
10735 __Pyx_GOTREF(__pyx_t_8);
10736 __Pyx_GOTREF(__pyx_t_6);
10745 __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L6_except_error))
10746 __Pyx_XDECREF(__pyx_r);
10747 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10748 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10749 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10750 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10751 goto __pyx_L7_except_return;
10753 goto __pyx_L6_except_error;
10754 __pyx_L6_except_error:;
10763 __Pyx_XGIVEREF(__pyx_t_3);
10764 __Pyx_XGIVEREF(__pyx_t_4);
10765 __Pyx_XGIVEREF(__pyx_t_5);
10766 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10767 goto __pyx_L1_error;
10768 __pyx_L7_except_return:;
10769 __Pyx_XGIVEREF(__pyx_t_3);
10770 __Pyx_XGIVEREF(__pyx_t_4);
10771 __Pyx_XGIVEREF(__pyx_t_5);
10772 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10793 __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L1_error))
10794 __Pyx_XDECREF(__pyx_r);
10795 __Pyx_INCREF(__pyx_v_obj);
10796 __pyx_r = __pyx_v_obj;
10809 __Pyx_XDECREF(__pyx_t_6);
10810 __Pyx_XDECREF(__pyx_t_7);
10811 __Pyx_XDECREF(__pyx_t_8);
10812 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10815 __Pyx_XDECREF(__pyx_v_obj);
10816 __Pyx_XGIVEREF(__pyx_r);
10817 __Pyx_TraceReturn(__pyx_r, 0);
10818 __Pyx_RefNannyFinishContext();
10830 static PyObject *__pyx_memoryview_setitem_slice_assignment(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
10831 __Pyx_memviewslice __pyx_v_dst_slice;
10832 __Pyx_memviewslice __pyx_v_src_slice;
10833 PyObject *__pyx_r = NULL;
10834 __Pyx_TraceDeclarations
10835 __Pyx_RefNannyDeclarations
10836 __Pyx_memviewslice *__pyx_t_1;
10837 __Pyx_memviewslice *__pyx_t_2;
10838 PyObject *__pyx_t_3 = NULL;
10842 int __pyx_lineno = 0;
10843 const char *__pyx_filename = NULL;
10844 int __pyx_clineno = 0;
10845 __Pyx_RefNannySetupContext(
"setitem_slice_assignment", 0);
10846 __Pyx_TraceCall(
"setitem_slice_assignment", __pyx_f[1], 441, 0, __PYX_ERR(1, 441, __pyx_L1_error));
10855 __Pyx_TraceLine(445,0,__PYX_ERR(1, 445, __pyx_L1_error))
10856 if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
10857 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
10866 __Pyx_TraceLine(446,0,__PYX_ERR(1, 446, __pyx_L1_error))
10867 if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
10868 __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((
struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice));
if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
10877 __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
10878 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
10879 __Pyx_GOTREF(__pyx_t_3);
10880 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_4 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
10881 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10882 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
10883 __Pyx_GOTREF(__pyx_t_3);
10884 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
10885 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10894 __Pyx_TraceLine(445,0,__PYX_ERR(1, 445, __pyx_L1_error))
10895 __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
10906 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10909 __Pyx_XDECREF(__pyx_t_3);
10910 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
10913 __Pyx_XGIVEREF(__pyx_r);
10914 __Pyx_TraceReturn(__pyx_r, 0);
10915 __Pyx_RefNannyFinishContext();
10927 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(
struct __pyx_memoryview_obj *__pyx_v_self,
struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
10928 int __pyx_v_array[0x80];
10930 void *__pyx_v_item;
10931 __Pyx_memviewslice *__pyx_v_dst_slice;
10932 __Pyx_memviewslice __pyx_v_tmp_slice;
10933 PyObject *__pyx_r = NULL;
10934 __Pyx_TraceDeclarations
10935 __Pyx_RefNannyDeclarations
10936 __Pyx_memviewslice *__pyx_t_1;
10938 PyObject *__pyx_t_3 = NULL;
10941 char const *__pyx_t_6;
10942 PyObject *__pyx_t_7 = NULL;
10943 PyObject *__pyx_t_8 = NULL;
10944 PyObject *__pyx_t_9 = NULL;
10945 PyObject *__pyx_t_10 = NULL;
10946 PyObject *__pyx_t_11 = NULL;
10947 PyObject *__pyx_t_12 = NULL;
10948 int __pyx_lineno = 0;
10949 const char *__pyx_filename = NULL;
10950 int __pyx_clineno = 0;
10951 __Pyx_RefNannySetupContext(
"setitem_slice_assign_scalar", 0);
10952 __Pyx_TraceCall(
"setitem_slice_assign_scalar", __pyx_f[1], 449, 0, __PYX_ERR(1, 449, __pyx_L1_error));
10961 __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
10962 __pyx_v_tmp = NULL;
10971 __Pyx_TraceLine(456,0,__PYX_ERR(1, 456, __pyx_L1_error))
10972 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
10973 __pyx_v_dst_slice = __pyx_t_1;
10982 __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
10983 __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (
sizeof(__pyx_v_array))) != 0);
10993 __Pyx_TraceLine(459,0,__PYX_ERR(1, 459, __pyx_L1_error))
10994 __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11003 __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
11004 __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11005 if (unlikely(__pyx_t_2)) {
11014 __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
11015 PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
11033 __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
11034 __pyx_v_item = __pyx_v_tmp;
11053 __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
11055 __pyx_v_item = ((
void *)__pyx_v_array);
11066 __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
11076 __Pyx_TraceLine(467,0,__PYX_ERR(1, 467, __pyx_L6_error))
11077 __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11087 __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L6_error))
11088 (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11107 __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
11109 __pyx_t_3 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((
char *)__pyx_v_item), __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
11110 __Pyx_GOTREF(__pyx_t_3);
11111 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11122 __Pyx_TraceLine(474,0,__PYX_ERR(1, 474, __pyx_L6_error))
11123 __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11133 __Pyx_TraceLine(475,0,__PYX_ERR(1, 475, __pyx_L6_error))
11134 __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
11135 __Pyx_GOTREF(__pyx_t_3);
11136 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11154 __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
11155 __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11165 __Pyx_TraceLine(479,0,__PYX_ERR(1, 479, __pyx_L6_error))
11168 PyMem_Free(__pyx_v_tmp);
11173 __Pyx_PyThreadState_declare
11174 __Pyx_PyThreadState_assign
11175 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11176 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11177 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11178 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
11179 __Pyx_XGOTREF(__pyx_t_7);
11180 __Pyx_XGOTREF(__pyx_t_8);
11181 __Pyx_XGOTREF(__pyx_t_9);
11182 __Pyx_XGOTREF(__pyx_t_10);
11183 __Pyx_XGOTREF(__pyx_t_11);
11184 __Pyx_XGOTREF(__pyx_t_12);
11185 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
11187 PyMem_Free(__pyx_v_tmp);
11189 if (PY_MAJOR_VERSION >= 3) {
11190 __Pyx_XGIVEREF(__pyx_t_10);
11191 __Pyx_XGIVEREF(__pyx_t_11);
11192 __Pyx_XGIVEREF(__pyx_t_12);
11193 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11195 __Pyx_XGIVEREF(__pyx_t_7);
11196 __Pyx_XGIVEREF(__pyx_t_8);
11197 __Pyx_XGIVEREF(__pyx_t_9);
11198 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
11199 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11200 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
11201 goto __pyx_L1_error;
11215 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11218 __Pyx_XDECREF(__pyx_t_3);
11219 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11222 __Pyx_XGIVEREF(__pyx_r);
11223 __Pyx_TraceReturn(__pyx_r, 0);
11224 __Pyx_RefNannyFinishContext();
11236 static PyObject *__pyx_memoryview_setitem_indexed(
struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11237 char *__pyx_v_itemp;
11238 PyObject *__pyx_r = NULL;
11239 __Pyx_TraceDeclarations
11240 __Pyx_RefNannyDeclarations
11242 PyObject *__pyx_t_2 = NULL;
11243 int __pyx_lineno = 0;
11244 const char *__pyx_filename = NULL;
11245 int __pyx_clineno = 0;
11246 __Pyx_RefNannySetupContext(
"setitem_indexed", 0);
11247 __Pyx_TraceCall(
"setitem_indexed", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
11256 __Pyx_TraceLine(482,0,__PYX_ERR(1, 482, __pyx_L1_error))
11257 __pyx_t_1 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index);
if (unlikely(__pyx_t_1 == ((
char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
11258 __pyx_v_itemp = __pyx_t_1;
11267 __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
11268 __pyx_t_2 = ((
struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
11269 __Pyx_GOTREF(__pyx_t_2);
11270 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11281 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11284 __Pyx_XDECREF(__pyx_t_2);
11285 __Pyx_AddTraceback(
"View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11288 __Pyx_XGIVEREF(__pyx_r);
11289 __Pyx_TraceReturn(__pyx_r, 0);
11290 __Pyx_RefNannyFinishContext();
11302 static PyObject *__pyx_memoryview_convert_item_to_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp) {
11303 PyObject *__pyx_v_struct = NULL;
11304 PyObject *__pyx_v_bytesitem = 0;
11305 PyObject *__pyx_v_result = NULL;
11306 PyObject *__pyx_r = NULL;
11307 __Pyx_TraceDeclarations
11308 __Pyx_RefNannyDeclarations
11309 PyObject *__pyx_t_1 = NULL;
11310 PyObject *__pyx_t_2 = NULL;
11311 PyObject *__pyx_t_3 = NULL;
11312 PyObject *__pyx_t_4 = NULL;
11313 PyObject *__pyx_t_5 = NULL;
11314 PyObject *__pyx_t_6 = NULL;
11315 PyObject *__pyx_t_7 = NULL;
11317 PyObject *__pyx_t_9 = NULL;
11320 int __pyx_lineno = 0;
11321 const char *__pyx_filename = NULL;
11322 int __pyx_clineno = 0;
11323 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
11324 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 485, 0, __PYX_ERR(1, 485, __pyx_L1_error));
11333 __Pyx_TraceLine(488,0,__PYX_ERR(1, 488, __pyx_L1_error))
11334 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
11335 __Pyx_GOTREF(__pyx_t_1);
11336 __pyx_v_struct = __pyx_t_1;
11346 __Pyx_TraceLine(491,0,__PYX_ERR(1, 491, __pyx_L1_error))
11347 __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
11348 __Pyx_GOTREF(__pyx_t_1);
11349 __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11359 __Pyx_TraceLine(492,0,__PYX_ERR(1, 492, __pyx_L1_error))
11361 __Pyx_PyThreadState_declare
11362 __Pyx_PyThreadState_assign
11363 __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11364 __Pyx_XGOTREF(__pyx_t_2);
11365 __Pyx_XGOTREF(__pyx_t_3);
11366 __Pyx_XGOTREF(__pyx_t_4);
11376 __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L3_error))
11377 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
11378 __Pyx_GOTREF(__pyx_t_5);
11379 __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
11380 __Pyx_GOTREF(__pyx_t_6);
11383 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11384 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11385 if (likely(__pyx_t_7)) {
11386 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
11387 __Pyx_INCREF(__pyx_t_7);
11388 __Pyx_INCREF(
function);
11389 __Pyx_DECREF_SET(__pyx_t_5,
function);
11393 #if CYTHON_FAST_PYCALL
11394 if (PyFunction_Check(__pyx_t_5)) {
11395 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11396 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11397 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11398 __Pyx_GOTREF(__pyx_t_1);
11399 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11402 #if CYTHON_FAST_PYCCALL
11403 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11404 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11405 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11406 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11407 __Pyx_GOTREF(__pyx_t_1);
11408 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11412 __pyx_t_9 = PyTuple_New(2+__pyx_t_8);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
11413 __Pyx_GOTREF(__pyx_t_9);
11415 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11417 __Pyx_GIVEREF(__pyx_t_6);
11418 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
11419 __Pyx_INCREF(__pyx_v_bytesitem);
11420 __Pyx_GIVEREF(__pyx_v_bytesitem);
11421 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
11423 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11424 __Pyx_GOTREF(__pyx_t_1);
11425 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11427 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11428 __pyx_v_result = __pyx_t_1;
11447 __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
11449 __pyx_t_10 = strlen(__pyx_v_self->view.format);
11450 __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11460 __Pyx_TraceLine(498,0,__PYX_ERR(1, 498, __pyx_L5_except_error))
11461 __Pyx_XDECREF(__pyx_r);
11462 __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
11463 __Pyx_GOTREF(__pyx_t_1);
11464 __pyx_r = __pyx_t_1;
11466 goto __pyx_L6_except_return;
11484 __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
11485 __Pyx_XDECREF(__pyx_r);
11486 __Pyx_INCREF(__pyx_v_result);
11487 __pyx_r = __pyx_v_result;
11488 goto __pyx_L6_except_return;
11491 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11492 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11493 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11494 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11495 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11504 __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L5_except_error))
11505 __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
11506 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
11507 __Pyx_GOTREF(__pyx_t_6);
11508 __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
11509 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11510 __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
11511 __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
11513 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11514 if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
11515 __Pyx_GOTREF(__pyx_t_9);
11516 __Pyx_GOTREF(__pyx_t_5);
11517 __Pyx_GOTREF(__pyx_t_1);
11526 __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L5_except_error))
11527 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
11528 __Pyx_GOTREF(__pyx_t_6);
11529 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
11530 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11531 __PYX_ERR(1, 495, __pyx_L5_except_error)
11533 goto __pyx_L5_except_error;
11534 __pyx_L5_except_error:;
11543 __Pyx_XGIVEREF(__pyx_t_2);
11544 __Pyx_XGIVEREF(__pyx_t_3);
11545 __Pyx_XGIVEREF(__pyx_t_4);
11546 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11547 goto __pyx_L1_error;
11548 __pyx_L6_except_return:;
11549 __Pyx_XGIVEREF(__pyx_t_2);
11550 __Pyx_XGIVEREF(__pyx_t_3);
11551 __Pyx_XGIVEREF(__pyx_t_4);
11552 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11566 __Pyx_XDECREF(__pyx_t_1);
11567 __Pyx_XDECREF(__pyx_t_5);
11568 __Pyx_XDECREF(__pyx_t_6);
11569 __Pyx_XDECREF(__pyx_t_7);
11570 __Pyx_XDECREF(__pyx_t_9);
11571 __Pyx_AddTraceback(
"View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11574 __Pyx_XDECREF(__pyx_v_struct);
11575 __Pyx_XDECREF(__pyx_v_bytesitem);
11576 __Pyx_XDECREF(__pyx_v_result);
11577 __Pyx_XGIVEREF(__pyx_r);
11578 __Pyx_TraceReturn(__pyx_r, 0);
11579 __Pyx_RefNannyFinishContext();
11591 static PyObject *__pyx_memoryview_assign_item_from_object(
struct __pyx_memoryview_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
11592 PyObject *__pyx_v_struct = NULL;
11594 PyObject *__pyx_v_bytesvalue = 0;
11595 Py_ssize_t __pyx_v_i;
11596 PyObject *__pyx_r = NULL;
11597 __Pyx_TraceDeclarations
11598 __Pyx_RefNannyDeclarations
11599 PyObject *__pyx_t_1 = NULL;
11602 PyObject *__pyx_t_4 = NULL;
11603 PyObject *__pyx_t_5 = NULL;
11604 PyObject *__pyx_t_6 = NULL;
11606 PyObject *__pyx_t_8 = NULL;
11607 Py_ssize_t __pyx_t_9;
11608 PyObject *__pyx_t_10 = NULL;
11613 int __pyx_lineno = 0;
11614 const char *__pyx_filename = NULL;
11615 int __pyx_clineno = 0;
11616 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
11617 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 501, 0, __PYX_ERR(1, 501, __pyx_L1_error));
11626 __Pyx_TraceLine(504,0,__PYX_ERR(1, 504, __pyx_L1_error))
11627 __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
11628 __Pyx_GOTREF(__pyx_t_1);
11629 __pyx_v_struct = __pyx_t_1;
11639 __Pyx_TraceLine(509,0,__PYX_ERR(1, 509, __pyx_L1_error))
11640 __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11641 __pyx_t_3 = (__pyx_t_2 != 0);
11651 __Pyx_TraceLine(510,0,__PYX_ERR(1, 510, __pyx_L1_error))
11652 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
11653 __Pyx_GOTREF(__pyx_t_1);
11654 __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11655 __Pyx_GOTREF(__pyx_t_4);
11656 __pyx_t_5 = PyTuple_New(1);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
11657 __Pyx_GOTREF(__pyx_t_5);
11658 __Pyx_GIVEREF(__pyx_t_4);
11659 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11661 __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11662 __Pyx_GOTREF(__pyx_t_4);
11663 __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
11664 __Pyx_GOTREF(__pyx_t_6);
11665 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11666 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11667 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11668 __Pyx_GOTREF(__pyx_t_4);
11669 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11670 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11671 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
11672 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11692 __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
11694 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
11695 __Pyx_GOTREF(__pyx_t_6);
11696 __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
11697 __Pyx_GOTREF(__pyx_t_1);
11700 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
11701 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
11702 if (likely(__pyx_t_5)) {
11703 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
11704 __Pyx_INCREF(__pyx_t_5);
11705 __Pyx_INCREF(
function);
11706 __Pyx_DECREF_SET(__pyx_t_6,
function);
11710 #if CYTHON_FAST_PYCALL
11711 if (PyFunction_Check(__pyx_t_6)) {
11712 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11713 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11714 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11715 __Pyx_GOTREF(__pyx_t_4);
11716 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11719 #if CYTHON_FAST_PYCCALL
11720 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
11721 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11722 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11723 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11724 __Pyx_GOTREF(__pyx_t_4);
11725 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11729 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
11730 __Pyx_GOTREF(__pyx_t_8);
11732 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
11734 __Pyx_GIVEREF(__pyx_t_1);
11735 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
11736 __Pyx_INCREF(__pyx_v_value);
11737 __Pyx_GIVEREF(__pyx_v_value);
11738 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
11740 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11741 __Pyx_GOTREF(__pyx_t_4);
11742 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11744 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11745 if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
11746 __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11758 __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
11760 if (unlikely(__pyx_v_bytesvalue == Py_None)) {
11761 PyErr_SetString(PyExc_TypeError,
"'NoneType' is not iterable");
11762 __PYX_ERR(1, 514, __pyx_L1_error)
11764 __Pyx_INCREF(__pyx_v_bytesvalue);
11765 __pyx_t_10 = __pyx_v_bytesvalue;
11766 __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
11767 __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
11768 for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
11769 __pyx_t_11 = __pyx_t_14;
11770 __pyx_v_c = (__pyx_t_11[0]);
11779 __Pyx_TraceLine(515,0,__PYX_ERR(1, 515, __pyx_L1_error))
11780 __pyx_v_i = __pyx_t_9;
11789 __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
11790 __pyx_t_9 = (__pyx_t_9 + 1);
11799 __Pyx_TraceLine(515,0,__PYX_ERR(1, 515, __pyx_L1_error))
11800 (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
11802 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11813 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11816 __Pyx_XDECREF(__pyx_t_1);
11817 __Pyx_XDECREF(__pyx_t_4);
11818 __Pyx_XDECREF(__pyx_t_5);
11819 __Pyx_XDECREF(__pyx_t_6);
11820 __Pyx_XDECREF(__pyx_t_8);
11821 __Pyx_XDECREF(__pyx_t_10);
11822 __Pyx_AddTraceback(
"View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11825 __Pyx_XDECREF(__pyx_v_struct);
11826 __Pyx_XDECREF(__pyx_v_bytesvalue);
11827 __Pyx_XGIVEREF(__pyx_r);
11828 __Pyx_TraceReturn(__pyx_r, 0);
11829 __Pyx_RefNannyFinishContext();
11842 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
11843 static CYTHON_UNUSED
int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
11845 __Pyx_RefNannyDeclarations
11846 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
11847 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
11850 __Pyx_RefNannyFinishContext();
11854 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(
struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
11856 __Pyx_TraceDeclarations
11857 __Pyx_RefNannyDeclarations
11860 PyObject *__pyx_t_3 = NULL;
11861 Py_ssize_t *__pyx_t_4;
11865 Py_ssize_t __pyx_t_8;
11866 int __pyx_lineno = 0;
11867 const char *__pyx_filename = NULL;
11868 int __pyx_clineno = 0;
11869 if (__pyx_v_info == NULL) {
11870 PyErr_SetString(PyExc_BufferError,
"PyObject_GetBuffer: view==NULL argument is obsolete");
11873 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
11874 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11875 __Pyx_GIVEREF(__pyx_v_info->obj);
11876 __Pyx_TraceCall(
"__getbuffer__", __pyx_f[1], 518, 0, __PYX_ERR(1, 518, __pyx_L1_error));
11885 __Pyx_TraceLine(519,0,__PYX_ERR(1, 519, __pyx_L1_error))
11886 __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11889 __pyx_t_1 = __pyx_t_2;
11890 goto __pyx_L4_bool_binop_done;
11892 __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
11893 __pyx_t_1 = __pyx_t_2;
11894 __pyx_L4_bool_binop_done:;
11895 if (unlikely(__pyx_t_1)) {
11904 __Pyx_TraceLine(520,0,__PYX_ERR(1, 520, __pyx_L1_error))
11905 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
11906 __Pyx_GOTREF(__pyx_t_3);
11907 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11908 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11909 __PYX_ERR(1, 520, __pyx_L1_error)
11927 __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
11928 __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11938 __Pyx_TraceLine(523,0,__PYX_ERR(1, 523, __pyx_L1_error))
11939 __pyx_t_4 = __pyx_v_self->view.shape;
11940 __pyx_v_info->shape = __pyx_t_4;
11959 __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
11961 __pyx_v_info->shape = NULL;
11972 __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
11973 __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
11983 __Pyx_TraceLine(528,0,__PYX_ERR(1, 528, __pyx_L1_error))
11984 __pyx_t_4 = __pyx_v_self->view.strides;
11985 __pyx_v_info->strides = __pyx_t_4;
12004 __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
12006 __pyx_v_info->strides = NULL;
12017 __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
12018 __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12028 __Pyx_TraceLine(533,0,__PYX_ERR(1, 533, __pyx_L1_error))
12029 __pyx_t_4 = __pyx_v_self->view.suboffsets;
12030 __pyx_v_info->suboffsets = __pyx_t_4;
12049 __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
12051 __pyx_v_info->suboffsets = NULL;
12062 __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
12063 __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12073 __Pyx_TraceLine(538,0,__PYX_ERR(1, 538, __pyx_L1_error))
12074 __pyx_t_5 = __pyx_v_self->view.format;
12075 __pyx_v_info->format = __pyx_t_5;
12094 __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
12096 __pyx_v_info->format = NULL;
12107 __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
12108 __pyx_t_6 = __pyx_v_self->view.buf;
12109 __pyx_v_info->buf = __pyx_t_6;
12118 __Pyx_TraceLine(543,0,__PYX_ERR(1, 543, __pyx_L1_error))
12119 __pyx_t_7 = __pyx_v_self->view.ndim;
12120 __pyx_v_info->ndim = __pyx_t_7;
12129 __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
12130 __pyx_t_8 = __pyx_v_self->view.itemsize;
12131 __pyx_v_info->itemsize = __pyx_t_8;
12140 __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
12141 __pyx_t_8 = __pyx_v_self->view.len;
12142 __pyx_v_info->len = __pyx_t_8;
12151 __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
12152 __pyx_t_1 = __pyx_v_self->view.readonly;
12153 __pyx_v_info->readonly = __pyx_t_1;
12162 __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
12163 __Pyx_INCREF(((PyObject *)__pyx_v_self));
12164 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12165 __Pyx_GOTREF(__pyx_v_info->obj);
12166 __Pyx_DECREF(__pyx_v_info->obj);
12167 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12181 __Pyx_XDECREF(__pyx_t_3);
12182 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12184 if (__pyx_v_info->obj != NULL) {
12185 __Pyx_GOTREF(__pyx_v_info->obj);
12186 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12190 if (__pyx_v_info->obj == Py_None) {
12191 __Pyx_GOTREF(__pyx_v_info->obj);
12192 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12195 __Pyx_TraceReturn(Py_None, 0);
12196 __Pyx_RefNannyFinishContext();
12209 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self);
12210 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12211 PyObject *__pyx_r = 0;
12212 __Pyx_RefNannyDeclarations
12213 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12214 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12217 __Pyx_RefNannyFinishContext();
12221 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12222 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12223 PyObject *__pyx_r = NULL;
12224 __Pyx_TraceDeclarations
12225 __Pyx_RefNannyDeclarations
12226 PyObject *__pyx_t_1 = NULL;
12228 int __pyx_lineno = 0;
12229 const char *__pyx_filename = NULL;
12230 int __pyx_clineno = 0;
12231 __Pyx_RefNannySetupContext(
"__get__", 0);
12232 __Pyx_TraceCall(
"__get__", __pyx_f[1], 553, 0, __PYX_ERR(1, 553, __pyx_L1_error));
12241 __Pyx_TraceLine(554,0,__PYX_ERR(1, 554, __pyx_L1_error))
12242 __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
12243 __Pyx_GOTREF(__pyx_t_1);
12244 if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
12245 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12255 __Pyx_TraceLine(555,0,__PYX_ERR(1, 555, __pyx_L1_error))
12256 __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice));
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
12265 __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
12266 __Pyx_XDECREF(__pyx_r);
12267 __Pyx_INCREF(((PyObject *)__pyx_v_result));
12268 __pyx_r = ((PyObject *)__pyx_v_result);
12281 __Pyx_XDECREF(__pyx_t_1);
12282 __Pyx_AddTraceback(
"View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12285 __Pyx_XDECREF((PyObject *)__pyx_v_result);
12286 __Pyx_XGIVEREF(__pyx_r);
12287 __Pyx_TraceReturn(__pyx_r, 0);
12288 __Pyx_RefNannyFinishContext();
12301 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self);
12302 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12303 PyObject *__pyx_r = 0;
12304 __Pyx_RefNannyDeclarations
12305 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12306 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12309 __Pyx_RefNannyFinishContext();
12313 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12314 PyObject *__pyx_r = NULL;
12315 __Pyx_TraceDeclarations
12316 __Pyx_RefNannyDeclarations
12317 int __pyx_lineno = 0;
12318 const char *__pyx_filename = NULL;
12319 int __pyx_clineno = 0;
12320 __Pyx_RefNannySetupContext(
"__get__", 0);
12321 __Pyx_TraceCall(
"__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
12330 __Pyx_TraceLine(560,0,__PYX_ERR(1, 560, __pyx_L1_error))
12331 __Pyx_XDECREF(__pyx_r);
12332 __Pyx_INCREF(__pyx_v_self->obj);
12333 __pyx_r = __pyx_v_self->obj;
12346 __Pyx_AddTraceback(
"View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12349 __Pyx_XGIVEREF(__pyx_r);
12350 __Pyx_TraceReturn(__pyx_r, 0);
12351 __Pyx_RefNannyFinishContext();
12364 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self);
12365 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12366 PyObject *__pyx_r = 0;
12367 __Pyx_RefNannyDeclarations
12368 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12369 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12372 __Pyx_RefNannyFinishContext();
12376 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12377 Py_ssize_t __pyx_v_length;
12378 PyObject *__pyx_r = NULL;
12379 __Pyx_TraceDeclarations
12380 __Pyx_RefNannyDeclarations
12381 PyObject *__pyx_t_1 = NULL;
12382 Py_ssize_t *__pyx_t_2;
12383 Py_ssize_t *__pyx_t_3;
12384 Py_ssize_t *__pyx_t_4;
12385 PyObject *__pyx_t_5 = NULL;
12386 int __pyx_lineno = 0;
12387 const char *__pyx_filename = NULL;
12388 int __pyx_clineno = 0;
12389 __Pyx_RefNannySetupContext(
"__get__", 0);
12390 __Pyx_TraceCall(
"__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
12399 __Pyx_TraceLine(564,0,__PYX_ERR(1, 564, __pyx_L1_error))
12400 __Pyx_XDECREF(__pyx_r);
12401 __pyx_t_1 = PyList_New(0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
12402 __Pyx_GOTREF(__pyx_t_1);
12403 __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12404 for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12405 __pyx_t_2 = __pyx_t_4;
12406 __pyx_v_length = (__pyx_t_2[0]);
12407 __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
12408 __Pyx_GOTREF(__pyx_t_5);
12409 if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
12410 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12412 __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1));
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
12413 __Pyx_GOTREF(__pyx_t_5);
12414 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12415 __pyx_r = __pyx_t_5;
12429 __Pyx_XDECREF(__pyx_t_1);
12430 __Pyx_XDECREF(__pyx_t_5);
12431 __Pyx_AddTraceback(
"View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12434 __Pyx_XGIVEREF(__pyx_r);
12435 __Pyx_TraceReturn(__pyx_r, 0);
12436 __Pyx_RefNannyFinishContext();
12449 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self);
12450 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
12451 PyObject *__pyx_r = 0;
12452 __Pyx_RefNannyDeclarations
12453 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12454 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12457 __Pyx_RefNannyFinishContext();
12461 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12462 Py_ssize_t __pyx_v_stride;
12463 PyObject *__pyx_r = NULL;
12464 __Pyx_TraceDeclarations
12465 __Pyx_RefNannyDeclarations
12467 PyObject *__pyx_t_2 = NULL;
12468 Py_ssize_t *__pyx_t_3;
12469 Py_ssize_t *__pyx_t_4;
12470 Py_ssize_t *__pyx_t_5;
12471 PyObject *__pyx_t_6 = NULL;
12472 int __pyx_lineno = 0;
12473 const char *__pyx_filename = NULL;
12474 int __pyx_clineno = 0;
12475 __Pyx_RefNannySetupContext(
"__get__", 0);
12476 __Pyx_TraceCall(
"__get__", __pyx_f[1], 567, 0, __PYX_ERR(1, 567, __pyx_L1_error));
12485 __Pyx_TraceLine(568,0,__PYX_ERR(1, 568, __pyx_L1_error))
12486 __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12487 if (unlikely(__pyx_t_1)) {
12496 __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
12497 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
12498 __Pyx_GOTREF(__pyx_t_2);
12499 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12500 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12501 __PYX_ERR(1, 570, __pyx_L1_error)
12519 __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
12520 __Pyx_XDECREF(__pyx_r);
12521 __pyx_t_2 = PyList_New(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
12522 __Pyx_GOTREF(__pyx_t_2);
12523 __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
12524 for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12525 __pyx_t_3 = __pyx_t_5;
12526 __pyx_v_stride = (__pyx_t_3[0]);
12527 __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
12528 __Pyx_GOTREF(__pyx_t_6);
12529 if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
12530 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12532 __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
12533 __Pyx_GOTREF(__pyx_t_6);
12534 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12535 __pyx_r = __pyx_t_6;
12549 __Pyx_XDECREF(__pyx_t_2);
12550 __Pyx_XDECREF(__pyx_t_6);
12551 __Pyx_AddTraceback(
"View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12554 __Pyx_XGIVEREF(__pyx_r);
12555 __Pyx_TraceReturn(__pyx_r, 0);
12556 __Pyx_RefNannyFinishContext();
12569 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self);
12570 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
12571 PyObject *__pyx_r = 0;
12572 __Pyx_RefNannyDeclarations
12573 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12574 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12577 __Pyx_RefNannyFinishContext();
12581 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12582 Py_ssize_t __pyx_v_suboffset;
12583 PyObject *__pyx_r = NULL;
12584 __Pyx_TraceDeclarations
12585 __Pyx_RefNannyDeclarations
12587 PyObject *__pyx_t_2 = NULL;
12588 PyObject *__pyx_t_3 = NULL;
12589 Py_ssize_t *__pyx_t_4;
12590 Py_ssize_t *__pyx_t_5;
12591 Py_ssize_t *__pyx_t_6;
12592 int __pyx_lineno = 0;
12593 const char *__pyx_filename = NULL;
12594 int __pyx_clineno = 0;
12595 __Pyx_RefNannySetupContext(
"__get__", 0);
12596 __Pyx_TraceCall(
"__get__", __pyx_f[1], 575, 0, __PYX_ERR(1, 575, __pyx_L1_error));
12605 __Pyx_TraceLine(576,0,__PYX_ERR(1, 576, __pyx_L1_error))
12606 __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
12616 __Pyx_TraceLine(577,0,__PYX_ERR(1, 577, __pyx_L1_error))
12617 __Pyx_XDECREF(__pyx_r);
12618 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
12619 __Pyx_GOTREF(__pyx_t_2);
12620 __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__29, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
12621 __Pyx_GOTREF(__pyx_t_3);
12622 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12623 __pyx_r = __pyx_t_3;
12643 __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
12644 __Pyx_XDECREF(__pyx_r);
12645 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
12646 __Pyx_GOTREF(__pyx_t_3);
12647 __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
12648 for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
12649 __pyx_t_4 = __pyx_t_6;
12650 __pyx_v_suboffset = (__pyx_t_4[0]);
12651 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12652 __Pyx_GOTREF(__pyx_t_2);
12653 if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
12654 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12656 __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12657 __Pyx_GOTREF(__pyx_t_2);
12658 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12659 __pyx_r = __pyx_t_2;
12673 __Pyx_XDECREF(__pyx_t_2);
12674 __Pyx_XDECREF(__pyx_t_3);
12675 __Pyx_AddTraceback(
"View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12678 __Pyx_XGIVEREF(__pyx_r);
12679 __Pyx_TraceReturn(__pyx_r, 0);
12680 __Pyx_RefNannyFinishContext();
12693 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self);
12694 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
12695 PyObject *__pyx_r = 0;
12696 __Pyx_RefNannyDeclarations
12697 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12698 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12701 __Pyx_RefNannyFinishContext();
12705 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12706 PyObject *__pyx_r = NULL;
12707 __Pyx_TraceDeclarations
12708 __Pyx_RefNannyDeclarations
12709 PyObject *__pyx_t_1 = NULL;
12710 int __pyx_lineno = 0;
12711 const char *__pyx_filename = NULL;
12712 int __pyx_clineno = 0;
12713 __Pyx_RefNannySetupContext(
"__get__", 0);
12714 __Pyx_TraceCall(
"__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
12723 __Pyx_TraceLine(583,0,__PYX_ERR(1, 583, __pyx_L1_error))
12724 __Pyx_XDECREF(__pyx_r);
12725 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
12726 __Pyx_GOTREF(__pyx_t_1);
12727 __pyx_r = __pyx_t_1;
12741 __Pyx_XDECREF(__pyx_t_1);
12742 __Pyx_AddTraceback(
"View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12745 __Pyx_XGIVEREF(__pyx_r);
12746 __Pyx_TraceReturn(__pyx_r, 0);
12747 __Pyx_RefNannyFinishContext();
12760 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self);
12761 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
12762 PyObject *__pyx_r = 0;
12763 __Pyx_RefNannyDeclarations
12764 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12765 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12768 __Pyx_RefNannyFinishContext();
12772 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12773 PyObject *__pyx_r = NULL;
12774 __Pyx_TraceDeclarations
12775 __Pyx_RefNannyDeclarations
12776 PyObject *__pyx_t_1 = NULL;
12777 int __pyx_lineno = 0;
12778 const char *__pyx_filename = NULL;
12779 int __pyx_clineno = 0;
12780 __Pyx_RefNannySetupContext(
"__get__", 0);
12781 __Pyx_TraceCall(
"__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
12790 __Pyx_TraceLine(587,0,__PYX_ERR(1, 587, __pyx_L1_error))
12791 __Pyx_XDECREF(__pyx_r);
12792 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
12793 __Pyx_GOTREF(__pyx_t_1);
12794 __pyx_r = __pyx_t_1;
12808 __Pyx_XDECREF(__pyx_t_1);
12809 __Pyx_AddTraceback(
"View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12812 __Pyx_XGIVEREF(__pyx_r);
12813 __Pyx_TraceReturn(__pyx_r, 0);
12814 __Pyx_RefNannyFinishContext();
12827 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self);
12828 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
12829 PyObject *__pyx_r = 0;
12830 __Pyx_RefNannyDeclarations
12831 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12832 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12835 __Pyx_RefNannyFinishContext();
12839 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12840 PyObject *__pyx_r = NULL;
12841 __Pyx_TraceDeclarations
12842 __Pyx_RefNannyDeclarations
12843 PyObject *__pyx_t_1 = NULL;
12844 PyObject *__pyx_t_2 = NULL;
12845 PyObject *__pyx_t_3 = NULL;
12846 int __pyx_lineno = 0;
12847 const char *__pyx_filename = NULL;
12848 int __pyx_clineno = 0;
12849 __Pyx_RefNannySetupContext(
"__get__", 0);
12850 __Pyx_TraceCall(
"__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
12859 __Pyx_TraceLine(591,0,__PYX_ERR(1, 591, __pyx_L1_error))
12860 __Pyx_XDECREF(__pyx_r);
12861 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
12862 __Pyx_GOTREF(__pyx_t_1);
12863 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
12864 __Pyx_GOTREF(__pyx_t_2);
12865 __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
12866 __Pyx_GOTREF(__pyx_t_3);
12867 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12868 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12869 __pyx_r = __pyx_t_3;
12883 __Pyx_XDECREF(__pyx_t_1);
12884 __Pyx_XDECREF(__pyx_t_2);
12885 __Pyx_XDECREF(__pyx_t_3);
12886 __Pyx_AddTraceback(
"View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12889 __Pyx_XGIVEREF(__pyx_r);
12890 __Pyx_TraceReturn(__pyx_r, 0);
12891 __Pyx_RefNannyFinishContext();
12904 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self);
12905 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
12906 PyObject *__pyx_r = 0;
12907 __Pyx_RefNannyDeclarations
12908 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
12909 __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
12912 __Pyx_RefNannyFinishContext();
12916 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(
struct __pyx_memoryview_obj *__pyx_v_self) {
12917 PyObject *__pyx_v_result = NULL;
12918 PyObject *__pyx_v_length = NULL;
12919 PyObject *__pyx_r = NULL;
12920 __Pyx_TraceDeclarations
12921 __Pyx_RefNannyDeclarations
12924 Py_ssize_t *__pyx_t_3;
12925 Py_ssize_t *__pyx_t_4;
12926 Py_ssize_t *__pyx_t_5;
12927 PyObject *__pyx_t_6 = NULL;
12928 int __pyx_lineno = 0;
12929 const char *__pyx_filename = NULL;
12930 int __pyx_clineno = 0;
12931 __Pyx_RefNannySetupContext(
"__get__", 0);
12932 __Pyx_TraceCall(
"__get__", __pyx_f[1], 594, 0, __PYX_ERR(1, 594, __pyx_L1_error));
12941 __Pyx_TraceLine(595,0,__PYX_ERR(1, 595, __pyx_L1_error))
12942 __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12943 __pyx_t_2 = (__pyx_t_1 != 0);
12953 __Pyx_TraceLine(596,0,__PYX_ERR(1, 596, __pyx_L1_error))
12954 __Pyx_INCREF(__pyx_int_1);
12955 __pyx_v_result = __pyx_int_1;
12964 __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
12965 __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12966 for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12967 __pyx_t_3 = __pyx_t_5;
12968 __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0]));
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
12969 __Pyx_GOTREF(__pyx_t_6);
12970 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
12980 __Pyx_TraceLine(599,0,__PYX_ERR(1, 599, __pyx_L1_error))
12981 __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
12982 __Pyx_GOTREF(__pyx_t_6);
12983 __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
12994 __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
12995 __Pyx_INCREF(__pyx_v_result);
12996 __Pyx_GIVEREF(__pyx_v_result);
12997 __Pyx_GOTREF(__pyx_v_self->_size);
12998 __Pyx_DECREF(__pyx_v_self->_size);
12999 __pyx_v_self->_size = __pyx_v_result;
13017 __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
13018 __Pyx_XDECREF(__pyx_r);
13019 __Pyx_INCREF(__pyx_v_self->_size);
13020 __pyx_r = __pyx_v_self->_size;
13033 __Pyx_XDECREF(__pyx_t_6);
13034 __Pyx_AddTraceback(
"View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13037 __Pyx_XDECREF(__pyx_v_result);
13038 __Pyx_XDECREF(__pyx_v_length);
13039 __Pyx_XGIVEREF(__pyx_r);
13040 __Pyx_TraceReturn(__pyx_r, 0);
13041 __Pyx_RefNannyFinishContext();
13054 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self);
13055 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13056 Py_ssize_t __pyx_r;
13057 __Pyx_RefNannyDeclarations
13058 __Pyx_RefNannySetupContext(
"__len__ (wrapper)", 0);
13059 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13062 __Pyx_RefNannyFinishContext();
13066 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13067 Py_ssize_t __pyx_r;
13068 __Pyx_TraceDeclarations
13069 __Pyx_RefNannyDeclarations
13071 int __pyx_lineno = 0;
13072 const char *__pyx_filename = NULL;
13073 int __pyx_clineno = 0;
13074 __Pyx_RefNannySetupContext(
"__len__", 0);
13075 __Pyx_TraceCall(
"__len__", __pyx_f[1], 605, 0, __PYX_ERR(1, 605, __pyx_L1_error));
13084 __Pyx_TraceLine(606,0,__PYX_ERR(1, 606, __pyx_L1_error))
13085 __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13095 __Pyx_TraceLine(607,0,__PYX_ERR(1, 607, __pyx_L1_error))
13096 __pyx_r = (__pyx_v_self->view.shape[0]);
13115 __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
13129 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13132 __Pyx_TraceReturn(Py_None, 0);
13133 __Pyx_RefNannyFinishContext();
13146 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self);
13147 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13148 PyObject *__pyx_r = 0;
13149 __Pyx_RefNannyDeclarations
13150 __Pyx_RefNannySetupContext(
"__repr__ (wrapper)", 0);
13151 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13154 __Pyx_RefNannyFinishContext();
13158 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13159 PyObject *__pyx_r = NULL;
13160 __Pyx_TraceDeclarations
13161 __Pyx_RefNannyDeclarations
13162 PyObject *__pyx_t_1 = NULL;
13163 PyObject *__pyx_t_2 = NULL;
13164 PyObject *__pyx_t_3 = NULL;
13165 int __pyx_lineno = 0;
13166 const char *__pyx_filename = NULL;
13167 int __pyx_clineno = 0;
13168 __Pyx_RefNannySetupContext(
"__repr__", 0);
13169 __Pyx_TraceCall(
"__repr__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
13178 __Pyx_TraceLine(612,0,__PYX_ERR(1, 612, __pyx_L1_error))
13179 __Pyx_XDECREF(__pyx_r);
13180 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13181 __Pyx_GOTREF(__pyx_t_1);
13182 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13183 __Pyx_GOTREF(__pyx_t_2);
13184 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13185 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13186 __Pyx_GOTREF(__pyx_t_1);
13187 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13196 __Pyx_TraceLine(613,0,__PYX_ERR(1, 613, __pyx_L1_error))
13197 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
13198 __Pyx_GOTREF(__pyx_t_2);
13207 __Pyx_TraceLine(612,0,__PYX_ERR(1, 612, __pyx_L1_error))
13208 __pyx_t_3 = PyTuple_New(2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
13209 __Pyx_GOTREF(__pyx_t_3);
13210 __Pyx_GIVEREF(__pyx_t_1);
13211 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13212 __Pyx_GIVEREF(__pyx_t_2);
13213 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13216 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13217 __Pyx_GOTREF(__pyx_t_2);
13218 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13219 __pyx_r = __pyx_t_2;
13233 __Pyx_XDECREF(__pyx_t_1);
13234 __Pyx_XDECREF(__pyx_t_2);
13235 __Pyx_XDECREF(__pyx_t_3);
13236 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13239 __Pyx_XGIVEREF(__pyx_r);
13240 __Pyx_TraceReturn(__pyx_r, 0);
13241 __Pyx_RefNannyFinishContext();
13254 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self);
13255 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13256 PyObject *__pyx_r = 0;
13257 __Pyx_RefNannyDeclarations
13258 __Pyx_RefNannySetupContext(
"__str__ (wrapper)", 0);
13259 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13262 __Pyx_RefNannyFinishContext();
13266 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(
struct __pyx_memoryview_obj *__pyx_v_self) {
13267 PyObject *__pyx_r = NULL;
13268 __Pyx_TraceDeclarations
13269 __Pyx_RefNannyDeclarations
13270 PyObject *__pyx_t_1 = NULL;
13271 PyObject *__pyx_t_2 = NULL;
13272 int __pyx_lineno = 0;
13273 const char *__pyx_filename = NULL;
13274 int __pyx_clineno = 0;
13275 __Pyx_RefNannySetupContext(
"__str__", 0);
13276 __Pyx_TraceCall(
"__str__", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
13285 __Pyx_TraceLine(616,0,__PYX_ERR(1, 616, __pyx_L1_error))
13286 __Pyx_XDECREF(__pyx_r);
13287 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13288 __Pyx_GOTREF(__pyx_t_1);
13289 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13290 __Pyx_GOTREF(__pyx_t_2);
13291 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13292 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13293 __Pyx_GOTREF(__pyx_t_1);
13294 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13295 __pyx_t_2 = PyTuple_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13296 __Pyx_GOTREF(__pyx_t_2);
13297 __Pyx_GIVEREF(__pyx_t_1);
13298 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13300 __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13301 __Pyx_GOTREF(__pyx_t_1);
13302 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13303 __pyx_r = __pyx_t_1;
13317 __Pyx_XDECREF(__pyx_t_1);
13318 __Pyx_XDECREF(__pyx_t_2);
13319 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13322 __Pyx_XGIVEREF(__pyx_r);
13323 __Pyx_TraceReturn(__pyx_r, 0);
13324 __Pyx_RefNannyFinishContext();
13337 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13338 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
13339 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13340 PyObject *__pyx_r = 0;
13341 __Pyx_RefNannyDeclarations
13342 __Pyx_RefNannySetupContext(
"is_c_contig (wrapper)", 0);
13343 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13346 __Pyx_RefNannyFinishContext();
13350 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13351 __Pyx_memviewslice *__pyx_v_mslice;
13352 __Pyx_memviewslice __pyx_v_tmp;
13353 PyObject *__pyx_r = NULL;
13354 __Pyx_TraceDeclarations
13355 __Pyx_RefNannyDeclarations
13356 __Pyx_memviewslice *__pyx_t_1;
13357 PyObject *__pyx_t_2 = NULL;
13358 int __pyx_lineno = 0;
13359 const char *__pyx_filename = NULL;
13360 int __pyx_clineno = 0;
13361 __Pyx_RefNannySetupContext(
"is_c_contig", 0);
13362 __Pyx_TraceCall(
"is_c_contig", __pyx_f[1], 619, 0, __PYX_ERR(1, 619, __pyx_L1_error));
13371 __Pyx_TraceLine(622,0,__PYX_ERR(1, 622, __pyx_L1_error))
13372 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
13373 __pyx_v_mslice = __pyx_t_1;
13382 __Pyx_TraceLine(623,0,__PYX_ERR(1, 623, __pyx_L1_error))
13383 __Pyx_XDECREF(__pyx_r);
13384 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'C', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
13385 __Pyx_GOTREF(__pyx_t_2);
13386 __pyx_r = __pyx_t_2;
13400 __Pyx_XDECREF(__pyx_t_2);
13401 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13404 __Pyx_XGIVEREF(__pyx_r);
13405 __Pyx_TraceReturn(__pyx_r, 0);
13406 __Pyx_RefNannyFinishContext();
13419 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13420 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
13421 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13422 PyObject *__pyx_r = 0;
13423 __Pyx_RefNannyDeclarations
13424 __Pyx_RefNannySetupContext(
"is_f_contig (wrapper)", 0);
13425 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13428 __Pyx_RefNannyFinishContext();
13432 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(
struct __pyx_memoryview_obj *__pyx_v_self) {
13433 __Pyx_memviewslice *__pyx_v_mslice;
13434 __Pyx_memviewslice __pyx_v_tmp;
13435 PyObject *__pyx_r = NULL;
13436 __Pyx_TraceDeclarations
13437 __Pyx_RefNannyDeclarations
13438 __Pyx_memviewslice *__pyx_t_1;
13439 PyObject *__pyx_t_2 = NULL;
13440 int __pyx_lineno = 0;
13441 const char *__pyx_filename = NULL;
13442 int __pyx_clineno = 0;
13443 __Pyx_RefNannySetupContext(
"is_f_contig", 0);
13444 __Pyx_TraceCall(
"is_f_contig", __pyx_f[1], 625, 0, __PYX_ERR(1, 625, __pyx_L1_error));
13453 __Pyx_TraceLine(628,0,__PYX_ERR(1, 628, __pyx_L1_error))
13454 __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
13455 __pyx_v_mslice = __pyx_t_1;
13464 __Pyx_TraceLine(629,0,__PYX_ERR(1, 629, __pyx_L1_error))
13465 __Pyx_XDECREF(__pyx_r);
13466 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]),
'F', __pyx_v_self->view.ndim));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
13467 __Pyx_GOTREF(__pyx_t_2);
13468 __pyx_r = __pyx_t_2;
13482 __Pyx_XDECREF(__pyx_t_2);
13483 __Pyx_AddTraceback(
"View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13486 __Pyx_XGIVEREF(__pyx_r);
13487 __Pyx_TraceReturn(__pyx_r, 0);
13488 __Pyx_RefNannyFinishContext();
13501 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13502 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
13503 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13504 PyObject *__pyx_r = 0;
13505 __Pyx_RefNannyDeclarations
13506 __Pyx_RefNannySetupContext(
"copy (wrapper)", 0);
13507 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13510 __Pyx_RefNannyFinishContext();
13514 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(
struct __pyx_memoryview_obj *__pyx_v_self) {
13515 __Pyx_memviewslice __pyx_v_mslice;
13517 PyObject *__pyx_r = NULL;
13518 __Pyx_TraceDeclarations
13519 __Pyx_RefNannyDeclarations
13520 __Pyx_memviewslice __pyx_t_1;
13521 PyObject *__pyx_t_2 = NULL;
13522 int __pyx_lineno = 0;
13523 const char *__pyx_filename = NULL;
13524 int __pyx_clineno = 0;
13525 __Pyx_RefNannySetupContext(
"copy", 0);
13526 __Pyx_TraceCall(
"copy", __pyx_f[1], 631, 0, __PYX_ERR(1, 631, __pyx_L1_error));
13535 __Pyx_TraceLine(633,0,__PYX_ERR(1, 633, __pyx_L1_error))
13536 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13545 __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
13546 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13555 __Pyx_TraceLine(636,0,__PYX_ERR(1, 636, __pyx_L1_error))
13556 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((
char *)
"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
13557 __pyx_v_mslice = __pyx_t_1;
13566 __Pyx_TraceLine(641,0,__PYX_ERR(1, 641, __pyx_L1_error))
13567 __Pyx_XDECREF(__pyx_r);
13568 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
13569 __Pyx_GOTREF(__pyx_t_2);
13570 __pyx_r = __pyx_t_2;
13584 __Pyx_XDECREF(__pyx_t_2);
13585 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13588 __Pyx_XGIVEREF(__pyx_r);
13589 __Pyx_TraceReturn(__pyx_r, 0);
13590 __Pyx_RefNannyFinishContext();
13603 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13604 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
13605 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13606 PyObject *__pyx_r = 0;
13607 __Pyx_RefNannyDeclarations
13608 __Pyx_RefNannySetupContext(
"copy_fortran (wrapper)", 0);
13609 __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13612 __Pyx_RefNannyFinishContext();
13616 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(
struct __pyx_memoryview_obj *__pyx_v_self) {
13617 __Pyx_memviewslice __pyx_v_src;
13618 __Pyx_memviewslice __pyx_v_dst;
13620 PyObject *__pyx_r = NULL;
13621 __Pyx_TraceDeclarations
13622 __Pyx_RefNannyDeclarations
13623 __Pyx_memviewslice __pyx_t_1;
13624 PyObject *__pyx_t_2 = NULL;
13625 int __pyx_lineno = 0;
13626 const char *__pyx_filename = NULL;
13627 int __pyx_clineno = 0;
13628 __Pyx_RefNannySetupContext(
"copy_fortran", 0);
13629 __Pyx_TraceCall(
"copy_fortran", __pyx_f[1], 643, 0, __PYX_ERR(1, 643, __pyx_L1_error));
13638 __Pyx_TraceLine(645,0,__PYX_ERR(1, 645, __pyx_L1_error))
13639 __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13648 __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
13649 __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13658 __Pyx_TraceLine(648,0,__PYX_ERR(1, 648, __pyx_L1_error))
13659 __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((
char *)
"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object);
if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
13660 __pyx_v_dst = __pyx_t_1;
13669 __Pyx_TraceLine(653,0,__PYX_ERR(1, 653, __pyx_L1_error))
13670 __Pyx_XDECREF(__pyx_r);
13671 __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
13672 __Pyx_GOTREF(__pyx_t_2);
13673 __pyx_r = __pyx_t_2;
13687 __Pyx_XDECREF(__pyx_t_2);
13688 __Pyx_AddTraceback(
"View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
13691 __Pyx_XGIVEREF(__pyx_r);
13692 __Pyx_TraceReturn(__pyx_r, 0);
13693 __Pyx_RefNannyFinishContext();
13704 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
13705 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
13706 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13707 PyObject *__pyx_r = 0;
13708 __Pyx_RefNannyDeclarations
13709 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
13710 __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self));
13713 __Pyx_RefNannyFinishContext();
13717 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self) {
13718 PyObject *__pyx_r = NULL;
13719 __Pyx_TraceDeclarations
13720 __Pyx_RefNannyDeclarations
13721 PyObject *__pyx_t_1 = NULL;
13722 int __pyx_lineno = 0;
13723 const char *__pyx_filename = NULL;
13724 int __pyx_clineno = 0;
13725 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
13726 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13734 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
13735 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13736 __Pyx_GOTREF(__pyx_t_1);
13737 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13738 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13739 __PYX_ERR(1, 2, __pyx_L1_error)
13749 __Pyx_XDECREF(__pyx_t_1);
13750 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13752 __Pyx_XGIVEREF(__pyx_r);
13753 __Pyx_TraceReturn(__pyx_r, 0);
13754 __Pyx_RefNannyFinishContext();
13766 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
13767 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
13768 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13769 PyObject *__pyx_r = 0;
13770 __Pyx_RefNannyDeclarations
13771 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
13772 __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((
struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13775 __Pyx_RefNannyFinishContext();
13779 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13780 PyObject *__pyx_r = NULL;
13781 __Pyx_TraceDeclarations
13782 __Pyx_RefNannyDeclarations
13783 PyObject *__pyx_t_1 = NULL;
13784 int __pyx_lineno = 0;
13785 const char *__pyx_filename = NULL;
13786 int __pyx_clineno = 0;
13787 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
13788 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
13795 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
13796 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
13797 __Pyx_GOTREF(__pyx_t_1);
13798 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13799 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13800 __PYX_ERR(1, 4, __pyx_L1_error)
13811 __Pyx_XDECREF(__pyx_t_1);
13812 __Pyx_AddTraceback(
"View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13814 __Pyx_XGIVEREF(__pyx_r);
13815 __Pyx_TraceReturn(__pyx_r, 0);
13816 __Pyx_RefNannyFinishContext();
13828 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o,
int __pyx_v_flags,
int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
13829 struct __pyx_memoryview_obj *__pyx_v_result = 0;
13830 PyObject *__pyx_r = NULL;
13831 __Pyx_TraceDeclarations
13832 __Pyx_RefNannyDeclarations
13833 PyObject *__pyx_t_1 = NULL;
13834 PyObject *__pyx_t_2 = NULL;
13835 PyObject *__pyx_t_3 = NULL;
13836 int __pyx_lineno = 0;
13837 const char *__pyx_filename = NULL;
13838 int __pyx_clineno = 0;
13839 __Pyx_RefNannySetupContext(
"memoryview_cwrapper", 0);
13840 __Pyx_TraceCall(
"memoryview_cwrapper", __pyx_f[1], 657, 0, __PYX_ERR(1, 657, __pyx_L1_error));
13849 __Pyx_TraceLine(658,0,__PYX_ERR(1, 658, __pyx_L1_error))
13850 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
13851 __Pyx_GOTREF(__pyx_t_1);
13852 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
13853 __Pyx_GOTREF(__pyx_t_2);
13854 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
13855 __Pyx_GOTREF(__pyx_t_3);
13856 __Pyx_INCREF(__pyx_v_o);
13857 __Pyx_GIVEREF(__pyx_v_o);
13858 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
13859 __Pyx_GIVEREF(__pyx_t_1);
13860 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
13861 __Pyx_GIVEREF(__pyx_t_2);
13862 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
13865 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
13866 __Pyx_GOTREF(__pyx_t_2);
13867 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13868 __pyx_v_result = ((
struct __pyx_memoryview_obj *)__pyx_t_2);
13878 __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
13879 __pyx_v_result->typeinfo = __pyx_v_typeinfo;
13888 __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
13889 __Pyx_XDECREF(__pyx_r);
13890 __Pyx_INCREF(((PyObject *)__pyx_v_result));
13891 __pyx_r = ((PyObject *)__pyx_v_result);
13904 __Pyx_XDECREF(__pyx_t_1);
13905 __Pyx_XDECREF(__pyx_t_2);
13906 __Pyx_XDECREF(__pyx_t_3);
13907 __Pyx_AddTraceback(
"View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13910 __Pyx_XDECREF((PyObject *)__pyx_v_result);
13911 __Pyx_XGIVEREF(__pyx_r);
13912 __Pyx_TraceReturn(__pyx_r, 0);
13913 __Pyx_RefNannyFinishContext();
13925 static CYTHON_INLINE
int __pyx_memoryview_check(PyObject *__pyx_v_o) {
13927 __Pyx_TraceDeclarations
13928 __Pyx_RefNannyDeclarations
13930 int __pyx_lineno = 0;
13931 const char *__pyx_filename = NULL;
13932 int __pyx_clineno = 0;
13933 __Pyx_RefNannySetupContext(
"memoryview_check", 0);
13934 __Pyx_TraceCall(
"memoryview_check", __pyx_f[1], 663, 0, __PYX_ERR(1, 663, __pyx_L1_error));
13943 __Pyx_TraceLine(664,0,__PYX_ERR(1, 664, __pyx_L1_error))
13944 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
13945 __pyx_r = __pyx_t_1;
13958 __Pyx_WriteUnraisable(
"View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
13961 __Pyx_TraceReturn(Py_None, 0);
13962 __Pyx_RefNannyFinishContext();
13974 static PyObject *_unellipsify(PyObject *__pyx_v_index,
int __pyx_v_ndim) {
13975 PyObject *__pyx_v_tup = NULL;
13976 PyObject *__pyx_v_result = NULL;
13977 int __pyx_v_have_slices;
13978 int __pyx_v_seen_ellipsis;
13979 CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
13980 PyObject *__pyx_v_item = NULL;
13981 Py_ssize_t __pyx_v_nslices;
13982 PyObject *__pyx_r = NULL;
13983 __Pyx_TraceDeclarations
13984 __Pyx_RefNannyDeclarations
13987 PyObject *__pyx_t_3 = NULL;
13988 PyObject *__pyx_t_4 = NULL;
13989 Py_ssize_t __pyx_t_5;
13990 PyObject *(*__pyx_t_6)(PyObject *);
13991 PyObject *__pyx_t_7 = NULL;
13992 Py_ssize_t __pyx_t_8;
13995 PyObject *__pyx_t_11 = NULL;
13996 int __pyx_lineno = 0;
13997 const char *__pyx_filename = NULL;
13998 int __pyx_clineno = 0;
13999 __Pyx_RefNannySetupContext(
"_unellipsify", 0);
14000 __Pyx_TraceCall(
"_unellipsify", __pyx_f[1], 666, 0, __PYX_ERR(1, 666, __pyx_L1_error));
14009 __Pyx_TraceLine(671,0,__PYX_ERR(1, 671, __pyx_L1_error))
14010 __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14011 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14021 __Pyx_TraceLine(672,0,__PYX_ERR(1, 672, __pyx_L1_error))
14022 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
14023 __Pyx_GOTREF(__pyx_t_3);
14024 __Pyx_INCREF(__pyx_v_index);
14025 __Pyx_GIVEREF(__pyx_v_index);
14026 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14027 __pyx_v_tup = __pyx_t_3;
14047 __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
14049 __Pyx_INCREF(__pyx_v_index);
14050 __pyx_v_tup = __pyx_v_index;
14061 __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
14062 __pyx_t_3 = PyList_New(0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
14063 __Pyx_GOTREF(__pyx_t_3);
14064 __pyx_v_result = ((PyObject*)__pyx_t_3);
14074 __Pyx_TraceLine(677,0,__PYX_ERR(1, 677, __pyx_L1_error))
14075 __pyx_v_have_slices = 0;
14084 __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
14085 __pyx_v_seen_ellipsis = 0;
14094 __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
14095 __Pyx_INCREF(__pyx_int_0);
14096 __pyx_t_3 = __pyx_int_0;
14097 if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14098 __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14101 __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
14102 __Pyx_GOTREF(__pyx_t_4);
14103 __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
14106 if (likely(!__pyx_t_6)) {
14107 if (likely(PyList_CheckExact(__pyx_t_4))) {
14108 if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4))
break;
14109 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14110 __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14112 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14113 __Pyx_GOTREF(__pyx_t_7);
14116 if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4))
break;
14117 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14118 __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14120 __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++;
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14121 __Pyx_GOTREF(__pyx_t_7);
14125 __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14126 if (unlikely(!__pyx_t_7)) {
14127 PyObject* exc_type = PyErr_Occurred();
14129 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14130 else __PYX_ERR(1, 679, __pyx_L1_error)
14134 __Pyx_GOTREF(__pyx_t_7);
14136 __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14138 __Pyx_INCREF(__pyx_t_3);
14139 __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14140 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14141 __Pyx_GOTREF(__pyx_t_7);
14142 __Pyx_DECREF(__pyx_t_3);
14143 __pyx_t_3 = __pyx_t_7;
14153 __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
14154 __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14155 __pyx_t_1 = (__pyx_t_2 != 0);
14165 __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
14166 __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14176 __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
14177 __pyx_t_8 = PyObject_Length(__pyx_v_tup);
if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14178 __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
14179 __Pyx_GOTREF(__pyx_t_7);
14180 { Py_ssize_t __pyx_temp;
14181 for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14182 __Pyx_INCREF(__pyx_slice__32);
14183 __Pyx_GIVEREF(__pyx_slice__32);
14184 PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__32);
14187 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14188 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14197 __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
14198 __pyx_v_seen_ellipsis = 1;
14217 __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
14219 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__32);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
14230 __Pyx_TraceLine(686,0,__PYX_ERR(1, 686, __pyx_L1_error))
14231 __pyx_v_have_slices = 1;
14250 __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
14252 __pyx_t_2 = PySlice_Check(__pyx_v_item);
14253 __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14256 __pyx_t_1 = __pyx_t_10;
14257 goto __pyx_L9_bool_binop_done;
14259 __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14260 __pyx_t_1 = __pyx_t_10;
14261 __pyx_L9_bool_binop_done:;
14262 if (unlikely(__pyx_t_1)) {
14271 __Pyx_TraceLine(689,0,__PYX_ERR(1, 689, __pyx_L1_error))
14272 __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item)));
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
14273 __Pyx_GOTREF(__pyx_t_7);
14274 __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
14275 __Pyx_GOTREF(__pyx_t_11);
14276 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14277 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14278 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14279 __PYX_ERR(1, 689, __pyx_L1_error)
14297 __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
14298 __pyx_t_10 = (__pyx_v_have_slices != 0);
14301 __pyx_t_1 = __pyx_t_10;
14302 goto __pyx_L11_bool_binop_done;
14304 __pyx_t_10 = PySlice_Check(__pyx_v_item);
14305 __pyx_t_2 = (__pyx_t_10 != 0);
14306 __pyx_t_1 = __pyx_t_2;
14307 __pyx_L11_bool_binop_done:;
14308 __pyx_v_have_slices = __pyx_t_1;
14317 __Pyx_TraceLine(692,0,__PYX_ERR(1, 692, __pyx_L1_error))
14318 __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
14329 __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
14331 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14332 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14341 __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
14342 __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result);
if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
14343 __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14352 __Pyx_TraceLine(695,0,__PYX_ERR(1, 695, __pyx_L1_error))
14353 __pyx_t_1 = (__pyx_v_nslices != 0);
14363 __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
14364 __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
14365 __Pyx_GOTREF(__pyx_t_3);
14366 { Py_ssize_t __pyx_temp;
14367 for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14368 __Pyx_INCREF(__pyx_slice__32);
14369 __Pyx_GIVEREF(__pyx_slice__32);
14370 PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32);
14373 __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3);
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
14374 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14392 __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
14393 __Pyx_XDECREF(__pyx_r);
14394 if (!__pyx_v_have_slices) {
14396 __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14397 __Pyx_GOTREF(__pyx_t_4);
14398 __pyx_t_3 = __pyx_t_4;
14400 goto __pyx_L14_bool_binop_done;
14402 __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14403 __Pyx_GOTREF(__pyx_t_4);
14404 __pyx_t_3 = __pyx_t_4;
14406 __pyx_L14_bool_binop_done:;
14407 __pyx_t_4 = PyList_AsTuple(__pyx_v_result);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14408 __Pyx_GOTREF(__pyx_t_4);
14409 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
14410 __Pyx_GOTREF(__pyx_t_11);
14411 __Pyx_GIVEREF(__pyx_t_3);
14412 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14413 __Pyx_GIVEREF(__pyx_t_4);
14414 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14417 __pyx_r = ((PyObject*)__pyx_t_11);
14431 __Pyx_XDECREF(__pyx_t_3);
14432 __Pyx_XDECREF(__pyx_t_4);
14433 __Pyx_XDECREF(__pyx_t_7);
14434 __Pyx_XDECREF(__pyx_t_11);
14435 __Pyx_AddTraceback(
"View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14438 __Pyx_XDECREF(__pyx_v_tup);
14439 __Pyx_XDECREF(__pyx_v_result);
14440 __Pyx_XDECREF(__pyx_v_idx);
14441 __Pyx_XDECREF(__pyx_v_item);
14442 __Pyx_XGIVEREF(__pyx_r);
14443 __Pyx_TraceReturn(__pyx_r, 0);
14444 __Pyx_RefNannyFinishContext();
14456 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets,
int __pyx_v_ndim) {
14457 Py_ssize_t __pyx_v_suboffset;
14458 PyObject *__pyx_r = NULL;
14459 __Pyx_TraceDeclarations
14460 __Pyx_RefNannyDeclarations
14461 Py_ssize_t *__pyx_t_1;
14462 Py_ssize_t *__pyx_t_2;
14463 Py_ssize_t *__pyx_t_3;
14465 PyObject *__pyx_t_5 = NULL;
14466 int __pyx_lineno = 0;
14467 const char *__pyx_filename = NULL;
14468 int __pyx_clineno = 0;
14469 __Pyx_RefNannySetupContext(
"assert_direct_dimensions", 0);
14470 __Pyx_TraceCall(
"assert_direct_dimensions", __pyx_f[1], 700, 0, __PYX_ERR(1, 700, __pyx_L1_error));
14479 __Pyx_TraceLine(701,0,__PYX_ERR(1, 701, __pyx_L1_error))
14480 __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14481 for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14482 __pyx_t_1 = __pyx_t_3;
14483 __pyx_v_suboffset = (__pyx_t_1[0]);
14492 __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
14493 __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14494 if (unlikely(__pyx_t_4)) {
14503 __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
14504 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
14505 __Pyx_GOTREF(__pyx_t_5);
14506 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14507 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14508 __PYX_ERR(1, 703, __pyx_L1_error)
14529 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14532 __Pyx_XDECREF(__pyx_t_5);
14533 __Pyx_AddTraceback(
"View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14536 __Pyx_XGIVEREF(__pyx_r);
14537 __Pyx_TraceReturn(__pyx_r, 0);
14538 __Pyx_RefNannyFinishContext();
14550 static struct __pyx_memoryview_obj *__pyx_memview_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14551 int __pyx_v_new_ndim;
14552 int __pyx_v_suboffset_dim;
14554 __Pyx_memviewslice __pyx_v_src;
14555 __Pyx_memviewslice __pyx_v_dst;
14556 __Pyx_memviewslice *__pyx_v_p_src;
14557 struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14558 __Pyx_memviewslice *__pyx_v_p_dst;
14559 int *__pyx_v_p_suboffset_dim;
14560 Py_ssize_t __pyx_v_start;
14561 Py_ssize_t __pyx_v_stop;
14562 Py_ssize_t __pyx_v_step;
14563 int __pyx_v_have_start;
14564 int __pyx_v_have_stop;
14565 int __pyx_v_have_step;
14566 PyObject *__pyx_v_index = NULL;
14567 struct __pyx_memoryview_obj *__pyx_r = NULL;
14568 __Pyx_TraceDeclarations
14569 __Pyx_RefNannyDeclarations
14572 PyObject *__pyx_t_3 = NULL;
14573 struct __pyx_memoryview_obj *__pyx_t_4;
14576 Py_ssize_t __pyx_t_7;
14577 PyObject *(*__pyx_t_8)(PyObject *);
14578 PyObject *__pyx_t_9 = NULL;
14579 Py_ssize_t __pyx_t_10;
14581 Py_ssize_t __pyx_t_12;
14582 int __pyx_lineno = 0;
14583 const char *__pyx_filename = NULL;
14584 int __pyx_clineno = 0;
14585 __Pyx_RefNannySetupContext(
"memview_slice", 0);
14586 __Pyx_TraceCall(
"memview_slice", __pyx_f[1], 710, 0, __PYX_ERR(1, 710, __pyx_L1_error));
14595 __Pyx_TraceLine(711,0,__PYX_ERR(1, 711, __pyx_L1_error))
14596 __pyx_v_new_ndim = 0;
14597 __pyx_v_suboffset_dim = -1;
14606 __Pyx_TraceLine(718,0,__PYX_ERR(1, 718, __pyx_L1_error))
14607 (void)(memset((&__pyx_v_dst), 0, (
sizeof(__pyx_v_dst))));
14616 __Pyx_TraceLine(722,0,__PYX_ERR(1, 722, __pyx_L1_error))
14617 #ifndef CYTHON_WITHOUT_ASSERTIONS
14618 if (unlikely(!Py_OptimizeFlag)) {
14619 if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14620 PyErr_SetNone(PyExc_AssertionError);
14621 __PYX_ERR(1, 722, __pyx_L1_error)
14633 __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
14634 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14635 __pyx_t_2 = (__pyx_t_1 != 0);
14645 __Pyx_TraceLine(725,0,__PYX_ERR(1, 725, __pyx_L1_error))
14646 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
14647 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14648 __Pyx_INCREF(__pyx_t_3);
14649 __pyx_v_memviewsliceobj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14659 __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
14660 __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14679 __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
14681 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14690 __Pyx_TraceLine(729,0,__PYX_ERR(1, 729, __pyx_L1_error))
14691 __pyx_v_p_src = (&__pyx_v_src);
14702 __Pyx_TraceLine(735,0,__PYX_ERR(1, 735, __pyx_L1_error))
14703 __pyx_t_4 = __pyx_v_p_src->memview;
14704 __pyx_v_dst.memview = __pyx_t_4;
14713 __Pyx_TraceLine(736,0,__PYX_ERR(1, 736, __pyx_L1_error))
14714 __pyx_t_5 = __pyx_v_p_src->data;
14715 __pyx_v_dst.data = __pyx_t_5;
14724 __Pyx_TraceLine(741,0,__PYX_ERR(1, 741, __pyx_L1_error))
14725 __pyx_v_p_dst = (&__pyx_v_dst);
14734 __Pyx_TraceLine(742,0,__PYX_ERR(1, 742, __pyx_L1_error))
14735 __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14744 __Pyx_TraceLine(746,0,__PYX_ERR(1, 746, __pyx_L1_error))
14746 if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14747 __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
14750 __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
14751 __Pyx_GOTREF(__pyx_t_3);
14752 __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
14755 if (likely(!__pyx_t_8)) {
14756 if (likely(PyList_CheckExact(__pyx_t_3))) {
14757 if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3))
break;
14758 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14759 __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
14761 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
14762 __Pyx_GOTREF(__pyx_t_9);
14765 if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3))
break;
14766 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14767 __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++;
if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
14769 __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++;
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
14770 __Pyx_GOTREF(__pyx_t_9);
14774 __pyx_t_9 = __pyx_t_8(__pyx_t_3);
14775 if (unlikely(!__pyx_t_9)) {
14776 PyObject* exc_type = PyErr_Occurred();
14778 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14779 else __PYX_ERR(1, 746, __pyx_L1_error)
14783 __Pyx_GOTREF(__pyx_t_9);
14785 __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
14787 __pyx_v_dim = __pyx_t_6;
14788 __pyx_t_6 = (__pyx_t_6 + 1);
14797 __Pyx_TraceLine(747,0,__PYX_ERR(1, 747, __pyx_L1_error))
14798 __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
14808 __Pyx_TraceLine(751,0,__PYX_ERR(1, 751, __pyx_L1_error))
14809 __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index);
if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
14818 __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
14819 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
14838 __Pyx_TraceLine(754,0,__PYX_ERR(1, 754, __pyx_L1_error))
14839 __pyx_t_2 = (__pyx_v_index == Py_None);
14840 __pyx_t_1 = (__pyx_t_2 != 0);
14850 __Pyx_TraceLine(755,0,__PYX_ERR(1, 755, __pyx_L1_error))
14851 (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
14860 __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
14861 (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
14870 __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
14871 (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
14880 __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
14881 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14900 __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
14902 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
14903 __Pyx_GOTREF(__pyx_t_9);
14904 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
14906 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14908 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
14909 __pyx_t_10 = __pyx_t_12;
14910 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14911 goto __pyx_L7_bool_binop_done;
14914 __pyx_L7_bool_binop_done:;
14915 __pyx_v_start = __pyx_t_10;
14924 __Pyx_TraceLine(761,0,__PYX_ERR(1, 761, __pyx_L1_error))
14925 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
14926 __Pyx_GOTREF(__pyx_t_9);
14927 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
14929 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14931 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
14932 __pyx_t_10 = __pyx_t_12;
14933 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14934 goto __pyx_L9_bool_binop_done;
14937 __pyx_L9_bool_binop_done:;
14938 __pyx_v_stop = __pyx_t_10;
14947 __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
14948 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
14949 __Pyx_GOTREF(__pyx_t_9);
14950 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9);
if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
14952 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14954 __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9);
if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
14955 __pyx_t_10 = __pyx_t_12;
14956 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14957 goto __pyx_L11_bool_binop_done;
14960 __pyx_L11_bool_binop_done:;
14961 __pyx_v_step = __pyx_t_10;
14970 __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
14971 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
14972 __Pyx_GOTREF(__pyx_t_9);
14973 __pyx_t_1 = (__pyx_t_9 != Py_None);
14974 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14975 __pyx_v_have_start = __pyx_t_1;
14984 __Pyx_TraceLine(765,0,__PYX_ERR(1, 765, __pyx_L1_error))
14985 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
14986 __Pyx_GOTREF(__pyx_t_9);
14987 __pyx_t_1 = (__pyx_t_9 != Py_None);
14988 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14989 __pyx_v_have_stop = __pyx_t_1;
14998 __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
14999 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step);
if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15000 __Pyx_GOTREF(__pyx_t_9);
15001 __pyx_t_1 = (__pyx_t_9 != Py_None);
15002 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15003 __pyx_v_have_step = __pyx_t_1;
15012 __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
15013 __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1);
if (unlikely(__pyx_t_11 == ((
int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
15022 __Pyx_TraceLine(774,0,__PYX_ERR(1, 774, __pyx_L1_error))
15023 __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15034 __Pyx_TraceLine(746,0,__PYX_ERR(1, 746, __pyx_L1_error))
15036 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15045 __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
15046 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15047 __pyx_t_2 = (__pyx_t_1 != 0);
15057 __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error))
15058 __Pyx_XDECREF(((PyObject *)__pyx_r));
15067 __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
15068 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
15077 __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
15078 if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError(
"memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
15087 __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error))
15088 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
15089 __Pyx_GOTREF(__pyx_t_3);
15090 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15091 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15111 __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error))
15113 __Pyx_XDECREF(((PyObject *)__pyx_r));
15122 __Pyx_TraceLine(783,0,__PYX_ERR(1, 783, __pyx_L1_error))
15123 __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
15124 __Pyx_GOTREF(__pyx_t_3);
15133 __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error))
15134 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
15135 __pyx_r = ((
struct __pyx_memoryview_obj *)__pyx_t_3);
15150 __Pyx_XDECREF(__pyx_t_3);
15151 __Pyx_XDECREF(__pyx_t_9);
15152 __Pyx_AddTraceback(
"View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15155 __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15156 __Pyx_XDECREF(__pyx_v_index);
15157 __Pyx_XGIVEREF((PyObject *)__pyx_r);
15158 __Pyx_TraceReturn(__pyx_r, 0);
15159 __Pyx_RefNannyFinishContext();
15171 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset,
int __pyx_v_dim,
int __pyx_v_new_ndim,
int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step,
int __pyx_v_have_start,
int __pyx_v_have_stop,
int __pyx_v_have_step,
int __pyx_v_is_slice) {
15172 Py_ssize_t __pyx_v_new_shape;
15173 int __pyx_v_negative_step;
15175 __Pyx_TraceDeclarations
15179 int __pyx_lineno = 0;
15180 const char *__pyx_filename = NULL;
15181 int __pyx_clineno = 0;
15182 __Pyx_TraceCall(
"slice_memviewslice", __pyx_f[1], 807, 1, __PYX_ERR(1, 807, __pyx_L1_error));
15191 __Pyx_TraceLine(827,1,__PYX_ERR(1, 827, __pyx_L1_error))
15192 __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15202 __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
15203 __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15213 __Pyx_TraceLine(830,1,__PYX_ERR(1, 830, __pyx_L1_error))
15214 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15232 __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
15233 __pyx_t_1 = (0 <= __pyx_v_start);
15235 __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15237 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15247 __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
15248 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"Index out of bounds (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
15276 __Pyx_TraceLine(835,1,__PYX_ERR(1, 835, __pyx_L1_error))
15278 __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15281 __pyx_t_2 = __pyx_t_1;
15282 goto __pyx_L6_bool_binop_done;
15284 __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15285 __pyx_t_2 = __pyx_t_1;
15286 __pyx_L6_bool_binop_done:;
15287 __pyx_v_negative_step = __pyx_t_2;
15296 __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
15297 __pyx_t_1 = (__pyx_v_have_step != 0);
15300 __pyx_t_2 = __pyx_t_1;
15301 goto __pyx_L9_bool_binop_done;
15303 __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15304 __pyx_t_2 = __pyx_t_1;
15305 __pyx_L9_bool_binop_done:;
15315 __Pyx_TraceLine(838,1,__PYX_ERR(1, 838, __pyx_L1_error))
15316 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Step may not be zero (axis %d)"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
15334 __Pyx_TraceLine(841,1,__PYX_ERR(1, 841, __pyx_L1_error))
15335 __pyx_t_2 = (__pyx_v_have_start != 0);
15345 __Pyx_TraceLine(842,1,__PYX_ERR(1, 842, __pyx_L1_error))
15346 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15356 __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
15357 __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15366 __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
15367 __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15377 __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
15406 __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
15407 __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15417 __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
15418 __pyx_t_2 = (__pyx_v_negative_step != 0);
15428 __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
15429 __pyx_v_start = (__pyx_v_shape - 1);
15448 __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
15450 __pyx_v_start = __pyx_v_shape;
15481 __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
15483 __pyx_t_2 = (__pyx_v_negative_step != 0);
15493 __Pyx_TraceLine(853,1,__PYX_ERR(1, 853, __pyx_L1_error))
15494 __pyx_v_start = (__pyx_v_shape - 1);
15513 __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
15528 __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
15529 __pyx_t_2 = (__pyx_v_have_stop != 0);
15539 __Pyx_TraceLine(858,1,__PYX_ERR(1, 858, __pyx_L1_error))
15540 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15550 __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
15551 __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15560 __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
15561 __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15571 __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
15600 __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
15601 __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15611 __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
15612 __pyx_v_stop = __pyx_v_shape;
15641 __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
15643 __pyx_t_2 = (__pyx_v_negative_step != 0);
15653 __Pyx_TraceLine(866,1,__PYX_ERR(1, 866, __pyx_L1_error))
15654 __pyx_v_stop = -1L;
15673 __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
15675 __pyx_v_stop = __pyx_v_shape;
15688 __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
15689 __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15699 __Pyx_TraceLine(871,1,__PYX_ERR(1, 871, __pyx_L1_error))
15718 __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15727 __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15737 __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15755 __Pyx_TraceLine(880,1,__PYX_ERR(1, 880, __pyx_L1_error))
15756 __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
15766 __Pyx_TraceLine(881,1,__PYX_ERR(1, 881, __pyx_L1_error))
15767 __pyx_v_new_shape = 0;
15785 __Pyx_TraceLine(884,1,__PYX_ERR(1, 884, __pyx_L1_error))
15786 (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
15795 __Pyx_TraceLine(885,1,__PYX_ERR(1, 885, __pyx_L1_error))
15796 (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
15805 __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
15806 (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
15817 __Pyx_TraceLine(889,1,__PYX_ERR(1, 889, __pyx_L1_error))
15818 __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
15828 __Pyx_TraceLine(890,1,__PYX_ERR(1, 890, __pyx_L1_error))
15829 __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
15848 __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
15850 __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
15851 (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
15862 __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
15863 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15873 __Pyx_TraceLine(895,1,__PYX_ERR(1, 895, __pyx_L1_error))
15874 __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
15884 __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
15885 __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
15895 __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
15896 __pyx_v_dst->data = ((((
char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
15915 __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
15925 __Pyx_TraceLine(900,1,__PYX_ERR(1, 900, __pyx_L1_error))
15926 __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((
char *)
"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
15947 __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
15949 (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
15969 __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
15985 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15987 __Pyx_AddTraceback(
"View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15989 __Pyx_PyGILState_Release(__pyx_gilstate_save);
15994 __Pyx_TraceReturn(Py_None, 1);
16006 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view,
char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16007 Py_ssize_t __pyx_v_shape;
16008 Py_ssize_t __pyx_v_stride;
16009 Py_ssize_t __pyx_v_suboffset;
16010 Py_ssize_t __pyx_v_itemsize;
16011 char *__pyx_v_resultp;
16013 __Pyx_TraceDeclarations
16014 __Pyx_RefNannyDeclarations
16015 Py_ssize_t __pyx_t_1;
16017 PyObject *__pyx_t_3 = NULL;
16018 PyObject *__pyx_t_4 = NULL;
16019 int __pyx_lineno = 0;
16020 const char *__pyx_filename = NULL;
16021 int __pyx_clineno = 0;
16022 __Pyx_RefNannySetupContext(
"pybuffer_index", 0);
16023 __Pyx_TraceCall(
"pybuffer_index", __pyx_f[1], 910, 0, __PYX_ERR(1, 910, __pyx_L1_error));
16032 __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
16033 __pyx_v_suboffset = -1L;
16042 __Pyx_TraceLine(913,0,__PYX_ERR(1, 913, __pyx_L1_error))
16043 __pyx_t_1 = __pyx_v_view->itemsize;
16044 __pyx_v_itemsize = __pyx_t_1;
16053 __Pyx_TraceLine(916,0,__PYX_ERR(1, 916, __pyx_L1_error))
16054 __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16064 __Pyx_TraceLine(917,0,__PYX_ERR(1, 917, __pyx_L1_error))
16065 if (unlikely(__pyx_v_itemsize == 0)) {
16066 PyErr_SetString(PyExc_ZeroDivisionError,
"integer division or modulo by zero");
16067 __PYX_ERR(1, 917, __pyx_L1_error)
16069 else if (
sizeof(Py_ssize_t) ==
sizeof(
long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16070 PyErr_SetString(PyExc_OverflowError,
"value too large to perform division");
16071 __PYX_ERR(1, 917, __pyx_L1_error)
16073 __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
16082 __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
16083 __pyx_v_stride = __pyx_v_itemsize;
16102 __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
16104 __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16113 __Pyx_TraceLine(921,0,__PYX_ERR(1, 921, __pyx_L1_error))
16114 __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16123 __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
16124 __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16134 __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
16135 __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16155 __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
16156 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16166 __Pyx_TraceLine(926,0,__PYX_ERR(1, 926, __pyx_L1_error))
16167 __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16176 __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
16177 __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16178 if (unlikely(__pyx_t_2)) {
16187 __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
16188 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16189 __Pyx_GOTREF(__pyx_t_3);
16190 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
16191 __Pyx_GOTREF(__pyx_t_4);
16192 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16193 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16194 __Pyx_GOTREF(__pyx_t_3);
16195 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16196 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16197 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16198 __PYX_ERR(1, 928, __pyx_L1_error)
16225 __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
16226 __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16227 if (unlikely(__pyx_t_2)) {
16236 __Pyx_TraceLine(931,0,__PYX_ERR(1, 931, __pyx_L1_error))
16237 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16238 __Pyx_GOTREF(__pyx_t_3);
16239 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
16240 __Pyx_GOTREF(__pyx_t_4);
16241 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16242 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16243 __Pyx_GOTREF(__pyx_t_3);
16244 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16245 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16246 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16247 __PYX_ERR(1, 931, __pyx_L1_error)
16265 __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
16266 __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16275 __Pyx_TraceLine(934,0,__PYX_ERR(1, 934, __pyx_L1_error))
16276 __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16286 __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
16287 __pyx_v_resultp = ((((
char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16305 __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
16306 __pyx_r = __pyx_v_resultp;
16319 __Pyx_XDECREF(__pyx_t_3);
16320 __Pyx_XDECREF(__pyx_t_4);
16321 __Pyx_AddTraceback(
"View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16324 __Pyx_TraceReturn(Py_None, 0);
16325 __Pyx_RefNannyFinishContext();
16337 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16339 Py_ssize_t *__pyx_v_shape;
16340 Py_ssize_t *__pyx_v_strides;
16344 __Pyx_TraceDeclarations
16346 Py_ssize_t *__pyx_t_2;
16349 Py_ssize_t __pyx_t_5;
16350 Py_ssize_t __pyx_t_6;
16354 int __pyx_lineno = 0;
16355 const char *__pyx_filename = NULL;
16356 int __pyx_clineno = 0;
16357 __Pyx_TraceCall(
"transpose_memslice", __pyx_f[1], 943, 1, __PYX_ERR(1, 943, __pyx_L1_error));
16366 __Pyx_TraceLine(944,1,__PYX_ERR(1, 944, __pyx_L1_error))
16367 __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16368 __pyx_v_ndim = __pyx_t_1;
16377 __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
16378 __pyx_t_2 = __pyx_v_memslice->shape;
16379 __pyx_v_shape = __pyx_t_2;
16388 __Pyx_TraceLine(947,1,__PYX_ERR(1, 947, __pyx_L1_error))
16389 __pyx_t_2 = __pyx_v_memslice->strides;
16390 __pyx_v_strides = __pyx_t_2;
16399 __Pyx_TraceLine(951,1,__PYX_ERR(1, 951, __pyx_L1_error))
16400 __pyx_t_3 = (__pyx_v_ndim / 2);
16401 __pyx_t_4 = __pyx_t_3;
16402 for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16403 __pyx_v_i = __pyx_t_1;
16412 __Pyx_TraceLine(952,1,__PYX_ERR(1, 952, __pyx_L1_error))
16413 __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16422 __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
16423 __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16424 __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16425 (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16426 (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16435 __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
16436 __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16437 __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16438 (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16439 (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16448 __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
16449 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16452 __pyx_t_7 = __pyx_t_8;
16453 goto __pyx_L6_bool_binop_done;
16455 __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16456 __pyx_t_7 = __pyx_t_8;
16457 __pyx_L6_bool_binop_done:;
16467 __Pyx_TraceLine(957,1,__PYX_ERR(1, 957, __pyx_L1_error))
16468 __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((
char *)
"Cannot transpose memoryview with indirect dimensions"));
if (unlikely(__pyx_t_9 == ((
int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
16487 __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
16503 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16505 __Pyx_AddTraceback(
"View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16507 __Pyx_PyGILState_Release(__pyx_gilstate_save);
16512 __Pyx_TraceReturn(Py_None, 1);
16525 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self);
16526 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16527 __Pyx_RefNannyDeclarations
16528 __Pyx_RefNannySetupContext(
"__dealloc__ (wrapper)", 0);
16529 __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16532 __Pyx_RefNannyFinishContext();
16535 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16536 __Pyx_TraceDeclarations
16537 __Pyx_RefNannyDeclarations
16538 int __pyx_lineno = 0;
16539 const char *__pyx_filename = NULL;
16540 int __pyx_clineno = 0;
16541 __Pyx_RefNannySetupContext(
"__dealloc__", 0);
16542 __Pyx_TraceCall(
"__dealloc__", __pyx_f[1], 976, 0, __PYX_ERR(1, 976, __pyx_L1_error));
16551 __Pyx_TraceLine(977,0,__PYX_ERR(1, 977, __pyx_L1_error))
16552 __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16565 __Pyx_WriteUnraisable(
"View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
16567 __Pyx_TraceReturn(Py_None, 0);
16568 __Pyx_RefNannyFinishContext();
16579 static PyObject *__pyx_memoryviewslice_convert_item_to_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp) {
16580 PyObject *__pyx_r = NULL;
16581 __Pyx_TraceDeclarations
16582 __Pyx_RefNannyDeclarations
16584 PyObject *__pyx_t_2 = NULL;
16585 int __pyx_lineno = 0;
16586 const char *__pyx_filename = NULL;
16587 int __pyx_clineno = 0;
16588 __Pyx_RefNannySetupContext(
"convert_item_to_object", 0);
16589 __Pyx_TraceCall(
"convert_item_to_object", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error));
16598 __Pyx_TraceLine(980,0,__PYX_ERR(1, 980, __pyx_L1_error))
16599 __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16609 __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
16610 __Pyx_XDECREF(__pyx_r);
16611 __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
16612 __Pyx_GOTREF(__pyx_t_2);
16613 __pyx_r = __pyx_t_2;
16633 __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
16635 __Pyx_XDECREF(__pyx_r);
16636 __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
16637 __Pyx_GOTREF(__pyx_t_2);
16638 __pyx_r = __pyx_t_2;
16653 __Pyx_XDECREF(__pyx_t_2);
16654 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16657 __Pyx_XGIVEREF(__pyx_r);
16658 __Pyx_TraceReturn(__pyx_r, 0);
16659 __Pyx_RefNannyFinishContext();
16671 static PyObject *__pyx_memoryviewslice_assign_item_from_object(
struct __pyx_memoryviewslice_obj *__pyx_v_self,
char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16672 PyObject *__pyx_r = NULL;
16673 __Pyx_TraceDeclarations
16674 __Pyx_RefNannyDeclarations
16677 PyObject *__pyx_t_3 = NULL;
16678 int __pyx_lineno = 0;
16679 const char *__pyx_filename = NULL;
16680 int __pyx_clineno = 0;
16681 __Pyx_RefNannySetupContext(
"assign_item_from_object", 0);
16682 __Pyx_TraceCall(
"assign_item_from_object", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error));
16691 __Pyx_TraceLine(986,0,__PYX_ERR(1, 986, __pyx_L1_error))
16692 __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16702 __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
16703 __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value);
if (unlikely(__pyx_t_2 == ((
int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
16722 __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
16724 __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((
struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
16725 __Pyx_GOTREF(__pyx_t_3);
16726 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16739 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16742 __Pyx_XDECREF(__pyx_t_3);
16743 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16746 __Pyx_XGIVEREF(__pyx_r);
16747 __Pyx_TraceReturn(__pyx_r, 0);
16748 __Pyx_RefNannyFinishContext();
16761 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self);
16762 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16763 PyObject *__pyx_r = 0;
16764 __Pyx_RefNannyDeclarations
16765 __Pyx_RefNannySetupContext(
"__get__ (wrapper)", 0);
16766 __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16769 __Pyx_RefNannyFinishContext();
16773 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16774 PyObject *__pyx_r = NULL;
16775 __Pyx_TraceDeclarations
16776 __Pyx_RefNannyDeclarations
16777 int __pyx_lineno = 0;
16778 const char *__pyx_filename = NULL;
16779 int __pyx_clineno = 0;
16780 __Pyx_RefNannySetupContext(
"__get__", 0);
16781 __Pyx_TraceCall(
"__get__", __pyx_f[1], 992, 0, __PYX_ERR(1, 992, __pyx_L1_error));
16790 __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L1_error))
16791 __Pyx_XDECREF(__pyx_r);
16792 __Pyx_INCREF(__pyx_v_self->from_object);
16793 __pyx_r = __pyx_v_self->from_object;
16806 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16809 __Pyx_XGIVEREF(__pyx_r);
16810 __Pyx_TraceReturn(__pyx_r, 0);
16811 __Pyx_RefNannyFinishContext();
16822 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused);
16823 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
16824 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16825 PyObject *__pyx_r = 0;
16826 __Pyx_RefNannyDeclarations
16827 __Pyx_RefNannySetupContext(
"__reduce_cython__ (wrapper)", 0);
16828 __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16831 __Pyx_RefNannyFinishContext();
16835 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16836 PyObject *__pyx_r = NULL;
16837 __Pyx_TraceDeclarations
16838 __Pyx_RefNannyDeclarations
16839 PyObject *__pyx_t_1 = NULL;
16840 int __pyx_lineno = 0;
16841 const char *__pyx_filename = NULL;
16842 int __pyx_clineno = 0;
16843 __Pyx_RefNannySetupContext(
"__reduce_cython__", 0);
16844 __Pyx_TraceCall(
"__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
16852 __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
16853 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
16854 __Pyx_GOTREF(__pyx_t_1);
16855 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16856 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16857 __PYX_ERR(1, 2, __pyx_L1_error)
16867 __Pyx_XDECREF(__pyx_t_1);
16868 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16870 __Pyx_XGIVEREF(__pyx_r);
16871 __Pyx_TraceReturn(__pyx_r, 0);
16872 __Pyx_RefNannyFinishContext();
16884 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state);
16885 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
16886 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16887 PyObject *__pyx_r = 0;
16888 __Pyx_RefNannyDeclarations
16889 __Pyx_RefNannySetupContext(
"__setstate_cython__ (wrapper)", 0);
16890 __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((
struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16893 __Pyx_RefNannyFinishContext();
16897 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED
struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16898 PyObject *__pyx_r = NULL;
16899 __Pyx_TraceDeclarations
16900 __Pyx_RefNannyDeclarations
16901 PyObject *__pyx_t_1 = NULL;
16902 int __pyx_lineno = 0;
16903 const char *__pyx_filename = NULL;
16904 int __pyx_clineno = 0;
16905 __Pyx_RefNannySetupContext(
"__setstate_cython__", 0);
16906 __Pyx_TraceCall(
"__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
16913 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
16914 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
16915 __Pyx_GOTREF(__pyx_t_1);
16916 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16917 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16918 __PYX_ERR(1, 4, __pyx_L1_error)
16929 __Pyx_XDECREF(__pyx_t_1);
16930 __Pyx_AddTraceback(
"View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16932 __Pyx_XGIVEREF(__pyx_r);
16933 __Pyx_TraceReturn(__pyx_r, 0);
16934 __Pyx_RefNannyFinishContext();
16946 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice,
int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(
char *),
int (*__pyx_v_to_dtype_func)(
char *, PyObject *),
int __pyx_v_dtype_is_object) {
16947 struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16948 Py_ssize_t __pyx_v_suboffset;
16949 PyObject *__pyx_v_length = NULL;
16950 PyObject *__pyx_r = NULL;
16951 __Pyx_TraceDeclarations
16952 __Pyx_RefNannyDeclarations
16954 PyObject *__pyx_t_2 = NULL;
16955 PyObject *__pyx_t_3 = NULL;
16956 __Pyx_TypeInfo *__pyx_t_4;
16957 Py_buffer __pyx_t_5;
16958 Py_ssize_t *__pyx_t_6;
16959 Py_ssize_t *__pyx_t_7;
16960 Py_ssize_t *__pyx_t_8;
16961 Py_ssize_t __pyx_t_9;
16962 int __pyx_lineno = 0;
16963 const char *__pyx_filename = NULL;
16964 int __pyx_clineno = 0;
16965 __Pyx_RefNannySetupContext(
"memoryview_fromslice", 0);
16966 __Pyx_TraceCall(
"memoryview_fromslice", __pyx_f[1], 999, 0, __PYX_ERR(1, 999, __pyx_L1_error));
16975 __Pyx_TraceLine(1007,0,__PYX_ERR(1, 1007, __pyx_L1_error))
16976 __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
16986 __Pyx_TraceLine(1008,0,__PYX_ERR(1, 1008, __pyx_L1_error))
16987 __Pyx_XDECREF(__pyx_r);
16988 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17007 __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error))
17008 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17009 __Pyx_GOTREF(__pyx_t_2);
17010 __pyx_t_3 = PyTuple_New(3);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17011 __Pyx_GOTREF(__pyx_t_3);
17012 __Pyx_INCREF(Py_None);
17013 __Pyx_GIVEREF(Py_None);
17014 PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17015 __Pyx_INCREF(__pyx_int_0);
17016 __Pyx_GIVEREF(__pyx_int_0);
17017 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17018 __Pyx_GIVEREF(__pyx_t_2);
17019 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17021 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17022 __Pyx_GOTREF(__pyx_t_2);
17023 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17024 __pyx_v_result = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17034 __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
17035 __pyx_v_result->from_slice = __pyx_v_memviewslice;
17044 __Pyx_TraceLine(1016,0,__PYX_ERR(1, 1016, __pyx_L1_error))
17045 __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17054 __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
17055 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
17056 __Pyx_GOTREF(__pyx_t_2);
17057 __Pyx_GIVEREF(__pyx_t_2);
17058 __Pyx_GOTREF(__pyx_v_result->from_object);
17059 __Pyx_DECREF(__pyx_v_result->from_object);
17060 __pyx_v_result->from_object = __pyx_t_2;
17070 __Pyx_TraceLine(1019,0,__PYX_ERR(1, 1019, __pyx_L1_error))
17071 __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17072 __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17081 __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
17082 __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17083 __pyx_v_result->__pyx_base.view = __pyx_t_5;
17092 __Pyx_TraceLine(1022,0,__PYX_ERR(1, 1022, __pyx_L1_error))
17093 __pyx_v_result->__pyx_base.view.buf = ((
void *)__pyx_v_memviewslice.data);
17102 __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
17103 __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17112 __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
17113 ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17122 __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
17123 Py_INCREF(Py_None);
17132 __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
17133 __pyx_t_1 = ((((
struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17143 __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error))
17144 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17163 __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
17165 __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17176 __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
17177 __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17186 __Pyx_TraceLine(1033,0,__PYX_ERR(1, 1033, __pyx_L1_error))
17187 __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17196 __Pyx_TraceLine(1036,0,__PYX_ERR(1, 1036, __pyx_L1_error))
17197 __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17206 __Pyx_TraceLine(1037,0,__PYX_ERR(1, 1037, __pyx_L1_error))
17207 __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17208 for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17209 __pyx_t_6 = __pyx_t_8;
17210 __pyx_v_suboffset = (__pyx_t_6[0]);
17219 __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
17220 __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17230 __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
17231 __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17240 __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
17241 goto __pyx_L6_break;
17261 __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
17262 __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17263 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17272 __Pyx_TraceLine(1043,0,__PYX_ERR(1, 1043, __pyx_L1_error))
17273 __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17274 for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17275 __pyx_t_6 = __pyx_t_8;
17276 __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0]));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
17277 __Pyx_GOTREF(__pyx_t_2);
17278 __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17288 __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
17289 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
17290 __Pyx_GOTREF(__pyx_t_2);
17291 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
17292 __Pyx_GOTREF(__pyx_t_3);
17293 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17294 __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3);
if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
17295 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17296 __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17306 __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
17307 __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17316 __Pyx_TraceLine(1047,0,__PYX_ERR(1, 1047, __pyx_L1_error))
17317 __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17326 __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
17327 __Pyx_XDECREF(__pyx_r);
17328 __Pyx_INCREF(((PyObject *)__pyx_v_result));
17329 __pyx_r = ((PyObject *)__pyx_v_result);
17342 __Pyx_XDECREF(__pyx_t_2);
17343 __Pyx_XDECREF(__pyx_t_3);
17344 __Pyx_AddTraceback(
"View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17347 __Pyx_XDECREF((PyObject *)__pyx_v_result);
17348 __Pyx_XDECREF(__pyx_v_length);
17349 __Pyx_XGIVEREF(__pyx_r);
17350 __Pyx_TraceReturn(__pyx_r, 0);
17351 __Pyx_RefNannyFinishContext();
17363 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17364 struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17365 __Pyx_memviewslice *__pyx_r;
17366 __Pyx_TraceDeclarations
17367 __Pyx_RefNannyDeclarations
17370 PyObject *__pyx_t_3 = NULL;
17371 int __pyx_lineno = 0;
17372 const char *__pyx_filename = NULL;
17373 int __pyx_clineno = 0;
17374 __Pyx_RefNannySetupContext(
"get_slice_from_memview", 0);
17375 __Pyx_TraceCall(
"get_slice_from_memview", __pyx_f[1], 1052, 0, __PYX_ERR(1, 1052, __pyx_L1_error));
17384 __Pyx_TraceLine(1055,0,__PYX_ERR(1, 1055, __pyx_L1_error))
17385 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17386 __pyx_t_2 = (__pyx_t_1 != 0);
17396 __Pyx_TraceLine(1056,0,__PYX_ERR(1, 1056, __pyx_L1_error))
17397 if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
17398 __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17399 __Pyx_INCREF(__pyx_t_3);
17400 __pyx_v_obj = ((
struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17410 __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
17411 __pyx_r = (&__pyx_v_obj->from_slice);
17430 __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
17432 __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17441 __Pyx_TraceLine(1060,0,__PYX_ERR(1, 1060, __pyx_L1_error))
17442 __pyx_r = __pyx_v_mslice;
17456 __Pyx_XDECREF(__pyx_t_3);
17457 __Pyx_AddTraceback(
"View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17460 __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17461 __Pyx_TraceReturn(Py_None, 0);
17462 __Pyx_RefNannyFinishContext();
17474 static void __pyx_memoryview_slice_copy(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17476 Py_ssize_t *__pyx_v_shape;
17477 Py_ssize_t *__pyx_v_strides;
17478 Py_ssize_t *__pyx_v_suboffsets;
17479 __Pyx_TraceDeclarations
17480 __Pyx_RefNannyDeclarations
17481 Py_ssize_t *__pyx_t_1;
17485 Py_ssize_t __pyx_t_5;
17486 int __pyx_lineno = 0;
17487 const char *__pyx_filename = NULL;
17488 int __pyx_clineno = 0;
17489 __Pyx_RefNannySetupContext(
"slice_copy", 0);
17490 __Pyx_TraceCall(
"slice_copy", __pyx_f[1], 1063, 0, __PYX_ERR(1, 1063, __pyx_L1_error));
17499 __Pyx_TraceLine(1067,0,__PYX_ERR(1, 1067, __pyx_L1_error))
17500 __pyx_t_1 = __pyx_v_memview->view.shape;
17501 __pyx_v_shape = __pyx_t_1;
17510 __Pyx_TraceLine(1068,0,__PYX_ERR(1, 1068, __pyx_L1_error))
17511 __pyx_t_1 = __pyx_v_memview->view.strides;
17512 __pyx_v_strides = __pyx_t_1;
17521 __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
17522 __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17523 __pyx_v_suboffsets = __pyx_t_1;
17532 __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
17533 __pyx_v_dst->memview = ((
struct __pyx_memoryview_obj *)__pyx_v_memview);
17542 __Pyx_TraceLine(1072,0,__PYX_ERR(1, 1072, __pyx_L1_error))
17543 __pyx_v_dst->data = ((
char *)__pyx_v_memview->view.buf);
17552 __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
17553 __pyx_t_2 = __pyx_v_memview->view.ndim;
17554 __pyx_t_3 = __pyx_t_2;
17555 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17556 __pyx_v_dim = __pyx_t_4;
17565 __Pyx_TraceLine(1075,0,__PYX_ERR(1, 1075, __pyx_L1_error))
17566 (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17575 __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
17576 (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17585 __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
17586 if ((__pyx_v_suboffsets != 0)) {
17587 __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17591 (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17605 __Pyx_WriteUnraisable(
"View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17607 __Pyx_TraceReturn(Py_None, 0);
17608 __Pyx_RefNannyFinishContext();
17619 static PyObject *__pyx_memoryview_copy_object(
struct __pyx_memoryview_obj *__pyx_v_memview) {
17620 __Pyx_memviewslice __pyx_v_memviewslice;
17621 PyObject *__pyx_r = NULL;
17622 __Pyx_TraceDeclarations
17623 __Pyx_RefNannyDeclarations
17624 PyObject *__pyx_t_1 = NULL;
17625 int __pyx_lineno = 0;
17626 const char *__pyx_filename = NULL;
17627 int __pyx_clineno = 0;
17628 __Pyx_RefNannySetupContext(
"memoryview_copy", 0);
17629 __Pyx_TraceCall(
"memoryview_copy", __pyx_f[1], 1080, 0, __PYX_ERR(1, 1080, __pyx_L1_error));
17638 __Pyx_TraceLine(1083,0,__PYX_ERR(1, 1083, __pyx_L1_error))
17639 __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17648 __Pyx_TraceLine(1084,0,__PYX_ERR(1, 1084, __pyx_L1_error))
17649 __Pyx_XDECREF(__pyx_r);
17650 __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice));
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
17651 __Pyx_GOTREF(__pyx_t_1);
17652 __pyx_r = __pyx_t_1;
17666 __Pyx_XDECREF(__pyx_t_1);
17667 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17670 __Pyx_XGIVEREF(__pyx_r);
17671 __Pyx_TraceReturn(__pyx_r, 0);
17672 __Pyx_RefNannyFinishContext();
17684 static PyObject *__pyx_memoryview_copy_object_from_slice(
struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17685 PyObject *(*__pyx_v_to_object_func)(
char *);
17686 int (*__pyx_v_to_dtype_func)(
char *, PyObject *);
17687 PyObject *__pyx_r = NULL;
17688 __Pyx_TraceDeclarations
17689 __Pyx_RefNannyDeclarations
17692 PyObject *(*__pyx_t_3)(
char *);
17693 int (*__pyx_t_4)(
char *, PyObject *);
17694 PyObject *__pyx_t_5 = NULL;
17695 int __pyx_lineno = 0;
17696 const char *__pyx_filename = NULL;
17697 int __pyx_clineno = 0;
17698 __Pyx_RefNannySetupContext(
"memoryview_copy_from_slice", 0);
17699 __Pyx_TraceCall(
"memoryview_copy_from_slice", __pyx_f[1], 1087, 0, __PYX_ERR(1, 1087, __pyx_L1_error));
17708 __Pyx_TraceLine(1094,0,__PYX_ERR(1, 1094, __pyx_L1_error))
17709 __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17710 __pyx_t_2 = (__pyx_t_1 != 0);
17720 __Pyx_TraceLine(1095,0,__PYX_ERR(1, 1095, __pyx_L1_error))
17721 __pyx_t_3 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17722 __pyx_v_to_object_func = __pyx_t_3;
17731 __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
17732 __pyx_t_4 = ((
struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17733 __pyx_v_to_dtype_func = __pyx_t_4;
17752 __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
17754 __pyx_v_to_object_func = NULL;
17763 __Pyx_TraceLine(1099,0,__PYX_ERR(1, 1099, __pyx_L1_error))
17764 __pyx_v_to_dtype_func = NULL;
17775 __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
17776 __Pyx_XDECREF(__pyx_r);
17785 __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
17786 __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object);
if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
17787 __Pyx_GOTREF(__pyx_t_5);
17788 __pyx_r = __pyx_t_5;
17802 __Pyx_XDECREF(__pyx_t_5);
17803 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17806 __Pyx_XGIVEREF(__pyx_r);
17807 __Pyx_TraceReturn(__pyx_r, 0);
17808 __Pyx_RefNannyFinishContext();
17820 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17821 Py_ssize_t __pyx_r;
17822 __Pyx_TraceDeclarations
17824 int __pyx_lineno = 0;
17825 const char *__pyx_filename = NULL;
17826 int __pyx_clineno = 0;
17827 __Pyx_TraceCall(
"abs_py_ssize_t", __pyx_f[1], 1109, 1, __PYX_ERR(1, 1109, __pyx_L1_error));
17836 __Pyx_TraceLine(1110,1,__PYX_ERR(1, 1110, __pyx_L1_error))
17837 __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17847 __Pyx_TraceLine(1111,1,__PYX_ERR(1, 1111, __pyx_L1_error))
17848 __pyx_r = (-__pyx_v_arg);
17867 __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
17869 __pyx_r = __pyx_v_arg;
17883 __Pyx_WriteUnraisable(
"View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17886 __Pyx_TraceReturn(Py_None, 1);
17898 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim) {
17900 Py_ssize_t __pyx_v_c_stride;
17901 Py_ssize_t __pyx_v_f_stride;
17903 __Pyx_TraceDeclarations
17908 int __pyx_lineno = 0;
17909 const char *__pyx_filename = NULL;
17910 int __pyx_clineno = 0;
17911 __Pyx_TraceCall(
"get_best_order", __pyx_f[1], 1116, 1, __PYX_ERR(1, 1116, __pyx_L1_error));
17920 __Pyx_TraceLine(1121,1,__PYX_ERR(1, 1121, __pyx_L1_error))
17921 __pyx_v_c_stride = 0;
17930 __Pyx_TraceLine(1122,1,__PYX_ERR(1, 1122, __pyx_L1_error))
17931 __pyx_v_f_stride = 0;
17940 __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
17941 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17942 __pyx_v_i = __pyx_t_1;
17951 __Pyx_TraceLine(1125,1,__PYX_ERR(1, 1125, __pyx_L1_error))
17952 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17962 __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
17963 __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17972 __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
17973 goto __pyx_L4_break;
17993 __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
17994 __pyx_t_1 = __pyx_v_ndim;
17995 __pyx_t_3 = __pyx_t_1;
17996 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17997 __pyx_v_i = __pyx_t_4;
18006 __Pyx_TraceLine(1130,1,__PYX_ERR(1, 1130, __pyx_L1_error))
18007 __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18017 __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
18018 __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18027 __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
18028 goto __pyx_L7_break;
18048 __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
18049 __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18059 __Pyx_TraceLine(1135,1,__PYX_ERR(1, 1135, __pyx_L1_error))
18079 __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
18095 __Pyx_WriteUnraisable(
"View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18098 __Pyx_TraceReturn(Py_None, 1);
18110 static void _copy_strided_to_strided(
char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides,
char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18111 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18112 CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18113 Py_ssize_t __pyx_v_dst_extent;
18114 Py_ssize_t __pyx_v_src_stride;
18115 Py_ssize_t __pyx_v_dst_stride;
18119 Py_ssize_t __pyx_t_4;
18120 Py_ssize_t __pyx_t_5;
18121 Py_ssize_t __pyx_t_6;
18130 __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18139 __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18148 __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18157 __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18166 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18176 __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18179 __pyx_t_1 = __pyx_t_2;
18180 goto __pyx_L5_bool_binop_done;
18182 __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18185 __pyx_t_1 = __pyx_t_2;
18186 goto __pyx_L5_bool_binop_done;
18196 __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18198 __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18200 __pyx_t_3 = (__pyx_t_2 != 0);
18201 __pyx_t_1 = __pyx_t_3;
18202 __pyx_L5_bool_binop_done:;
18220 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18240 __pyx_t_4 = __pyx_v_dst_extent;
18241 __pyx_t_5 = __pyx_t_4;
18242 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18243 __pyx_v_i = __pyx_t_6;
18252 (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18261 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18270 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18293 __pyx_t_4 = __pyx_v_dst_extent;
18294 __pyx_t_5 = __pyx_t_4;
18295 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18296 __pyx_v_i = __pyx_t_6;
18305 _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18314 __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18323 __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18347 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize) {
18348 __Pyx_TraceDeclarations
18349 int __pyx_lineno = 0;
18350 const char *__pyx_filename = NULL;
18351 int __pyx_clineno = 0;
18352 __Pyx_TraceCall(
"copy_strided_to_strided", __pyx_f[1], 1170, 1, __PYX_ERR(1, 1170, __pyx_L1_error));
18361 __Pyx_TraceLine(1173,1,__PYX_ERR(1, 1173, __pyx_L1_error))
18362 _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18375 __Pyx_WriteUnraisable(
"View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18377 __Pyx_TraceReturn(Py_None, 1);
18388 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src,
int __pyx_v_ndim) {
18389 Py_ssize_t __pyx_v_shape;
18390 Py_ssize_t __pyx_v_size;
18391 Py_ssize_t __pyx_r;
18392 __Pyx_TraceDeclarations
18393 Py_ssize_t __pyx_t_1;
18394 Py_ssize_t *__pyx_t_2;
18395 Py_ssize_t *__pyx_t_3;
18396 Py_ssize_t *__pyx_t_4;
18397 int __pyx_lineno = 0;
18398 const char *__pyx_filename = NULL;
18399 int __pyx_clineno = 0;
18400 __Pyx_TraceCall(
"slice_get_size", __pyx_f[1], 1177, 1, __PYX_ERR(1, 1177, __pyx_L1_error));
18409 __Pyx_TraceLine(1179,1,__PYX_ERR(1, 1179, __pyx_L1_error))
18410 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18411 __pyx_v_size = __pyx_t_1;
18420 __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
18421 __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18422 for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18423 __pyx_t_2 = __pyx_t_4;
18424 __pyx_v_shape = (__pyx_t_2[0]);
18433 __Pyx_TraceLine(1182,1,__PYX_ERR(1, 1182, __pyx_L1_error))
18434 __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18444 __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
18445 __pyx_r = __pyx_v_size;
18458 __Pyx_WriteUnraisable(
"View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18461 __Pyx_TraceReturn(Py_None, 1);
18473 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride,
int __pyx_v_ndim,
char __pyx_v_order) {
18475 Py_ssize_t __pyx_r;
18476 __Pyx_TraceDeclarations
18481 int __pyx_lineno = 0;
18482 const char *__pyx_filename = NULL;
18483 int __pyx_clineno = 0;
18484 __Pyx_TraceCall(
"fill_contig_strides_array", __pyx_f[1], 1187, 1, __PYX_ERR(1, 1187, __pyx_L1_error));
18493 __Pyx_TraceLine(1196,1,__PYX_ERR(1, 1196, __pyx_L1_error))
18494 __pyx_t_1 = ((__pyx_v_order ==
'F') != 0);
18504 __Pyx_TraceLine(1197,1,__PYX_ERR(1, 1197, __pyx_L1_error))
18505 __pyx_t_2 = __pyx_v_ndim;
18506 __pyx_t_3 = __pyx_t_2;
18507 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18508 __pyx_v_idx = __pyx_t_4;
18517 __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
18518 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18527 __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
18528 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18548 __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
18550 for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18551 __pyx_v_idx = __pyx_t_2;
18560 __Pyx_TraceLine(1202,1,__PYX_ERR(1, 1202, __pyx_L1_error))
18561 (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18570 __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
18571 __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18583 __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
18584 __pyx_r = __pyx_v_stride;
18597 __Pyx_WriteUnraisable(
"View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18600 __Pyx_TraceReturn(Py_None, 1);
18612 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice,
char __pyx_v_order,
int __pyx_v_ndim) {
18614 void *__pyx_v_result;
18615 size_t __pyx_v_itemsize;
18616 size_t __pyx_v_size;
18618 __Pyx_TraceDeclarations
18619 Py_ssize_t __pyx_t_1;
18622 struct __pyx_memoryview_obj *__pyx_t_4;
18625 int __pyx_lineno = 0;
18626 const char *__pyx_filename = NULL;
18627 int __pyx_clineno = 0;
18628 __Pyx_TraceCall(
"copy_data_to_temp", __pyx_f[1], 1208, 1, __PYX_ERR(1, 1208, __pyx_L1_error));
18637 __Pyx_TraceLine(1219,1,__PYX_ERR(1, 1219, __pyx_L1_error))
18638 __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18639 __pyx_v_itemsize = __pyx_t_1;
18648 __Pyx_TraceLine(1220,1,__PYX_ERR(1, 1220, __pyx_L1_error))
18649 __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18658 __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
18659 __pyx_v_result = malloc(__pyx_v_size);
18668 __Pyx_TraceLine(1223,1,__PYX_ERR(1, 1223, __pyx_L1_error))
18669 __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18679 __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
18680 __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL);
if (unlikely(__pyx_t_3 == ((
int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
18698 __Pyx_TraceLine(1227,1,__PYX_ERR(1, 1227, __pyx_L1_error))
18699 __pyx_v_tmpslice->data = ((
char *)__pyx_v_result);
18708 __Pyx_TraceLine(1228,1,__PYX_ERR(1, 1228, __pyx_L1_error))
18709 __pyx_t_4 = __pyx_v_src->memview;
18710 __pyx_v_tmpslice->memview = __pyx_t_4;
18719 __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
18720 __pyx_t_3 = __pyx_v_ndim;
18721 __pyx_t_5 = __pyx_t_3;
18722 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18723 __pyx_v_i = __pyx_t_6;
18732 __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
18733 (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18742 __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
18743 (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18753 __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
18754 (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18763 __Pyx_TraceLine(1237,1,__PYX_ERR(1, 1237, __pyx_L1_error))
18764 __pyx_t_3 = __pyx_v_ndim;
18765 __pyx_t_5 = __pyx_t_3;
18766 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18767 __pyx_v_i = __pyx_t_6;
18776 __Pyx_TraceLine(1238,1,__PYX_ERR(1, 1238, __pyx_L1_error))
18777 __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18787 __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
18788 (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18807 __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
18808 __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18818 __Pyx_TraceLine(1242,1,__PYX_ERR(1, 1242, __pyx_L1_error))
18819 (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18838 __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
18840 copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18851 __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
18852 __pyx_r = __pyx_v_result;
18867 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18869 __Pyx_AddTraceback(
"View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18871 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18876 __Pyx_TraceReturn(Py_None, 1);
18888 static int __pyx_memoryview_err_extents(
int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18890 __Pyx_TraceDeclarations
18891 __Pyx_RefNannyDeclarations
18892 PyObject *__pyx_t_1 = NULL;
18893 PyObject *__pyx_t_2 = NULL;
18894 PyObject *__pyx_t_3 = NULL;
18895 PyObject *__pyx_t_4 = NULL;
18896 int __pyx_lineno = 0;
18897 const char *__pyx_filename = NULL;
18898 int __pyx_clineno = 0;
18900 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18902 __Pyx_RefNannySetupContext(
"_err_extents", 0);
18903 __Pyx_TraceCall(
"_err_extents", __pyx_f[1], 1251, 0, __PYX_ERR(1, 1251, __pyx_L1_error));
18912 __Pyx_TraceLine(1254,0,__PYX_ERR(1, 1254, __pyx_L1_error))
18913 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
18914 __Pyx_GOTREF(__pyx_t_1);
18915 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
18916 __Pyx_GOTREF(__pyx_t_2);
18917 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
18918 __Pyx_GOTREF(__pyx_t_3);
18919 __pyx_t_4 = PyTuple_New(3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
18920 __Pyx_GOTREF(__pyx_t_4);
18921 __Pyx_GIVEREF(__pyx_t_1);
18922 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18923 __Pyx_GIVEREF(__pyx_t_2);
18924 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18925 __Pyx_GIVEREF(__pyx_t_3);
18926 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18938 __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
18939 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
18940 __Pyx_GOTREF(__pyx_t_3);
18941 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18942 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
18943 __Pyx_GOTREF(__pyx_t_4);
18944 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18945 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18946 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18947 __PYX_ERR(1, 1253, __pyx_L1_error)
18959 __Pyx_XDECREF(__pyx_t_1);
18960 __Pyx_XDECREF(__pyx_t_2);
18961 __Pyx_XDECREF(__pyx_t_3);
18962 __Pyx_XDECREF(__pyx_t_4);
18963 __Pyx_AddTraceback(
"View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18965 __Pyx_TraceReturn(Py_None, 0);
18966 __Pyx_RefNannyFinishContext();
18968 __Pyx_PyGILState_Release(__pyx_gilstate_save);
18981 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error,
char *__pyx_v_msg,
int __pyx_v_dim) {
18983 __Pyx_TraceDeclarations
18984 __Pyx_RefNannyDeclarations
18985 PyObject *__pyx_t_1 = NULL;
18986 PyObject *__pyx_t_2 = NULL;
18987 PyObject *__pyx_t_3 = NULL;
18988 PyObject *__pyx_t_4 = NULL;
18989 int __pyx_lineno = 0;
18990 const char *__pyx_filename = NULL;
18991 int __pyx_clineno = 0;
18993 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18995 __Pyx_RefNannySetupContext(
"_err_dim", 0);
18996 __Pyx_TraceCall(
"_err_dim", __pyx_f[1], 1257, 0, __PYX_ERR(1, 1257, __pyx_L1_error));
18997 __Pyx_INCREF(__pyx_v_error);
19006 __Pyx_TraceLine(1258,0,__PYX_ERR(1, 1258, __pyx_L1_error))
19007 __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19008 __Pyx_GOTREF(__pyx_t_2);
19009 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19010 __Pyx_GOTREF(__pyx_t_3);
19011 __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19012 __Pyx_GOTREF(__pyx_t_4);
19013 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19014 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19015 __Pyx_INCREF(__pyx_v_error);
19016 __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19017 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19018 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19019 if (likely(__pyx_t_2)) {
19020 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_3);
19021 __Pyx_INCREF(__pyx_t_2);
19022 __Pyx_INCREF(
function);
19023 __Pyx_DECREF_SET(__pyx_t_3,
function);
19026 __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19027 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19028 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19029 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19030 __Pyx_GOTREF(__pyx_t_1);
19031 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19032 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19033 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19034 __PYX_ERR(1, 1258, __pyx_L1_error)
19046 __Pyx_XDECREF(__pyx_t_1);
19047 __Pyx_XDECREF(__pyx_t_2);
19048 __Pyx_XDECREF(__pyx_t_3);
19049 __Pyx_XDECREF(__pyx_t_4);
19050 __Pyx_AddTraceback(
"View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19052 __Pyx_XDECREF(__pyx_v_error);
19053 __Pyx_TraceReturn(Py_None, 0);
19054 __Pyx_RefNannyFinishContext();
19056 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19069 static int __pyx_memoryview_err(PyObject *__pyx_v_error,
char *__pyx_v_msg) {
19071 __Pyx_TraceDeclarations
19072 __Pyx_RefNannyDeclarations
19074 PyObject *__pyx_t_2 = NULL;
19075 PyObject *__pyx_t_3 = NULL;
19076 PyObject *__pyx_t_4 = NULL;
19077 PyObject *__pyx_t_5 = NULL;
19078 int __pyx_lineno = 0;
19079 const char *__pyx_filename = NULL;
19080 int __pyx_clineno = 0;
19082 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19084 __Pyx_RefNannySetupContext(
"_err", 0);
19085 __Pyx_TraceCall(
"_err", __pyx_f[1], 1261, 0, __PYX_ERR(1, 1261, __pyx_L1_error));
19086 __Pyx_INCREF(__pyx_v_error);
19095 __Pyx_TraceLine(1262,0,__PYX_ERR(1, 1262, __pyx_L1_error))
19096 __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19097 if (unlikely(__pyx_t_1)) {
19106 __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
19107 __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
19108 __Pyx_GOTREF(__pyx_t_3);
19109 __Pyx_INCREF(__pyx_v_error);
19110 __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19111 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19112 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19113 if (likely(__pyx_t_5)) {
19114 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
19115 __Pyx_INCREF(__pyx_t_5);
19116 __Pyx_INCREF(
function);
19117 __Pyx_DECREF_SET(__pyx_t_4,
function);
19120 __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19121 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19122 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19123 if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
19124 __Pyx_GOTREF(__pyx_t_2);
19125 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19126 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19127 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19128 __PYX_ERR(1, 1263, __pyx_L1_error)
19146 __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
19148 __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19149 __PYX_ERR(1, 1265, __pyx_L1_error)
19162 __Pyx_XDECREF(__pyx_t_2);
19163 __Pyx_XDECREF(__pyx_t_3);
19164 __Pyx_XDECREF(__pyx_t_4);
19165 __Pyx_XDECREF(__pyx_t_5);
19166 __Pyx_AddTraceback(
"View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19168 __Pyx_XDECREF(__pyx_v_error);
19169 __Pyx_TraceReturn(Py_None, 0);
19170 __Pyx_RefNannyFinishContext();
19172 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19185 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst,
int __pyx_v_src_ndim,
int __pyx_v_dst_ndim,
int __pyx_v_dtype_is_object) {
19186 void *__pyx_v_tmpdata;
19187 size_t __pyx_v_itemsize;
19189 char __pyx_v_order;
19190 int __pyx_v_broadcasting;
19191 int __pyx_v_direct_copy;
19192 __Pyx_memviewslice __pyx_v_tmp;
19195 __Pyx_TraceDeclarations
19196 Py_ssize_t __pyx_t_1;
19204 int __pyx_lineno = 0;
19205 const char *__pyx_filename = NULL;
19206 int __pyx_clineno = 0;
19207 __Pyx_TraceCall(
"memoryview_copy_contents", __pyx_f[1], 1268, 1, __PYX_ERR(1, 1268, __pyx_L1_error));
19216 __Pyx_TraceLine(1276,1,__PYX_ERR(1, 1276, __pyx_L1_error))
19217 __pyx_v_tmpdata = NULL;
19226 __Pyx_TraceLine(1277,1,__PYX_ERR(1, 1277, __pyx_L1_error))
19227 __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19228 __pyx_v_itemsize = __pyx_t_1;
19237 __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
19238 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19247 __Pyx_TraceLine(1280,1,__PYX_ERR(1, 1280, __pyx_L1_error))
19248 __pyx_v_broadcasting = 0;
19257 __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
19258 __pyx_v_direct_copy = 0;
19267 __Pyx_TraceLine(1284,1,__PYX_ERR(1, 1284, __pyx_L1_error))
19268 __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19278 __Pyx_TraceLine(1285,1,__PYX_ERR(1, 1285, __pyx_L1_error))
19279 __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19298 __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
19299 __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19309 __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
19310 __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19329 __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
19330 __pyx_t_3 = __pyx_v_dst_ndim;
19331 __pyx_t_4 = __pyx_v_src_ndim;
19332 if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19333 __pyx_t_5 = __pyx_t_3;
19335 __pyx_t_5 = __pyx_t_4;
19337 __pyx_v_ndim = __pyx_t_5;
19346 __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
19347 __pyx_t_5 = __pyx_v_ndim;
19348 __pyx_t_3 = __pyx_t_5;
19349 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19350 __pyx_v_i = __pyx_t_4;
19359 __Pyx_TraceLine(1292,1,__PYX_ERR(1, 1292, __pyx_L1_error))
19360 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19370 __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
19371 __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19381 __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
19382 __pyx_v_broadcasting = 1;
19391 __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
19392 (__pyx_v_src.strides[__pyx_v_i]) = 0;
19411 __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
19413 __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i]));
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
19433 __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
19434 __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19444 __Pyx_TraceLine(1300,1,__PYX_ERR(1, 1300, __pyx_L1_error))
19445 __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((
char *)
"Dimension %d is not direct"), __pyx_v_i);
if (unlikely(__pyx_t_6 == ((
int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
19464 __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
19465 __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19475 __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
19476 __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19486 __Pyx_TraceLine(1305,1,__PYX_ERR(1, 1305, __pyx_L1_error))
19487 __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19505 __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
19506 __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim);
if (unlikely(__pyx_t_7 == ((
void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
19507 __pyx_v_tmpdata = __pyx_t_7;
19516 __Pyx_TraceLine(1308,1,__PYX_ERR(1, 1308, __pyx_L1_error))
19517 __pyx_v_src = __pyx_v_tmp;
19535 __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
19536 __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19546 __Pyx_TraceLine(1313,1,__PYX_ERR(1, 1313, __pyx_L1_error))
19547 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'C', __pyx_v_ndim) != 0);
19557 __Pyx_TraceLine(1314,1,__PYX_ERR(1, 1314, __pyx_L1_error))
19558 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'C', __pyx_v_ndim);
19577 __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
19578 __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src,
'F', __pyx_v_ndim) != 0);
19588 __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
19589 __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst,
'F', __pyx_v_ndim);
19608 __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
19609 __pyx_t_2 = (__pyx_v_direct_copy != 0);
19619 __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
19620 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19629 __Pyx_TraceLine(1321,1,__PYX_ERR(1, 1321, __pyx_L1_error))
19630 (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19639 __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
19640 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19649 __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
19650 free(__pyx_v_tmpdata);
19659 __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
19688 __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
19689 __pyx_t_2 = (__pyx_v_order ==
'F');
19691 __pyx_t_2 = (
'F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19693 __pyx_t_8 = (__pyx_t_2 != 0);
19703 __Pyx_TraceLine(1329,1,__PYX_ERR(1, 1329, __pyx_L1_error))
19704 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
19713 __Pyx_TraceLine(1330,1,__PYX_ERR(1, 1330, __pyx_L1_error))
19714 __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst));
if (unlikely(__pyx_t_5 == ((
int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
19732 __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
19733 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19742 __Pyx_TraceLine(1333,1,__PYX_ERR(1, 1333, __pyx_L1_error))
19743 copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19752 __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
19753 __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19762 __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
19763 free(__pyx_v_tmpdata);
19772 __Pyx_TraceLine(1337,1,__PYX_ERR(1, 1337, __pyx_L1_error))
19788 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19790 __Pyx_AddTraceback(
"View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19792 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19797 __Pyx_TraceReturn(Py_None, 1);
19809 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice,
int __pyx_v_ndim,
int __pyx_v_ndim_other) {
19811 int __pyx_v_offset;
19812 __Pyx_TraceDeclarations
19816 int __pyx_lineno = 0;
19817 const char *__pyx_filename = NULL;
19818 int __pyx_clineno = 0;
19819 __Pyx_TraceCall(
"broadcast_leading", __pyx_f[1], 1340, 1, __PYX_ERR(1, 1340, __pyx_L1_error));
19828 __Pyx_TraceLine(1344,1,__PYX_ERR(1, 1344, __pyx_L1_error))
19829 __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19838 __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
19839 for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19840 __pyx_v_i = __pyx_t_1;
19849 __Pyx_TraceLine(1347,1,__PYX_ERR(1, 1347, __pyx_L1_error))
19850 (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19859 __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
19860 (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19869 __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
19870 (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19880 __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
19881 __pyx_t_1 = __pyx_v_offset;
19882 __pyx_t_2 = __pyx_t_1;
19883 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19884 __pyx_v_i = __pyx_t_3;
19893 __Pyx_TraceLine(1352,1,__PYX_ERR(1, 1352, __pyx_L1_error))
19894 (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19903 __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
19904 (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19913 __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
19914 (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19928 __Pyx_WriteUnraisable(
"View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19930 __Pyx_TraceReturn(Py_None, 1);
19941 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_dtype_is_object,
int __pyx_v_ndim,
int __pyx_v_inc) {
19942 __Pyx_TraceDeclarations
19944 int __pyx_lineno = 0;
19945 const char *__pyx_filename = NULL;
19946 int __pyx_clineno = 0;
19947 __Pyx_TraceCall(
"refcount_copying", __pyx_f[1], 1362, 1, __PYX_ERR(1, 1362, __pyx_L1_error));
19956 __Pyx_TraceLine(1366,1,__PYX_ERR(1, 1366, __pyx_L1_error))
19957 __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19967 __Pyx_TraceLine(1367,1,__PYX_ERR(1, 1367, __pyx_L1_error))
19968 __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19990 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19992 __Pyx_TraceReturn(Py_None, 1);
20003 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20004 __Pyx_TraceDeclarations
20005 __Pyx_RefNannyDeclarations
20006 int __pyx_lineno = 0;
20007 const char *__pyx_filename = NULL;
20008 int __pyx_clineno = 0;
20010 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20012 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice_with_gil", 0);
20013 __Pyx_TraceCall(
"refcount_objects_in_slice_with_gil", __pyx_f[1], 1371, 0, __PYX_ERR(1, 1371, __pyx_L1_error));
20022 __Pyx_TraceLine(1374,0,__PYX_ERR(1, 1374, __pyx_L1_error))
20023 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20036 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20038 __Pyx_TraceReturn(Py_None, 0);
20039 __Pyx_RefNannyFinishContext();
20041 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20053 static void __pyx_memoryview_refcount_objects_in_slice(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
int __pyx_v_inc) {
20054 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20055 __Pyx_TraceDeclarations
20056 __Pyx_RefNannyDeclarations
20057 Py_ssize_t __pyx_t_1;
20058 Py_ssize_t __pyx_t_2;
20059 Py_ssize_t __pyx_t_3;
20061 int __pyx_lineno = 0;
20062 const char *__pyx_filename = NULL;
20063 int __pyx_clineno = 0;
20064 __Pyx_RefNannySetupContext(
"refcount_objects_in_slice", 0);
20065 __Pyx_TraceCall(
"refcount_objects_in_slice", __pyx_f[1], 1377, 0, __PYX_ERR(1, 1377, __pyx_L1_error));
20074 __Pyx_TraceLine(1381,0,__PYX_ERR(1, 1381, __pyx_L1_error))
20075 __pyx_t_1 = (__pyx_v_shape[0]);
20076 __pyx_t_2 = __pyx_t_1;
20077 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20078 __pyx_v_i = __pyx_t_3;
20087 __Pyx_TraceLine(1382,0,__PYX_ERR(1, 1382, __pyx_L1_error))
20088 __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20098 __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
20099 __pyx_t_4 = (__pyx_v_inc != 0);
20109 __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
20110 Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20129 __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
20131 Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20152 __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
20162 __Pyx_TraceLine(1389,0,__PYX_ERR(1, 1389, __pyx_L1_error))
20163 __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20174 __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
20175 __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20189 __Pyx_WriteUnraisable(
"View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20191 __Pyx_TraceReturn(Py_None, 0);
20192 __Pyx_RefNannyFinishContext();
20203 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item,
int __pyx_v_dtype_is_object) {
20204 __Pyx_TraceDeclarations
20205 int __pyx_lineno = 0;
20206 const char *__pyx_filename = NULL;
20207 int __pyx_clineno = 0;
20208 __Pyx_TraceCall(
"slice_assign_scalar", __pyx_f[1], 1397, 1, __PYX_ERR(1, 1397, __pyx_L1_error));
20217 __Pyx_TraceLine(1400,1,__PYX_ERR(1, 1400, __pyx_L1_error))
20218 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20227 __Pyx_TraceLine(1401,1,__PYX_ERR(1, 1401, __pyx_L1_error))
20228 __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20237 __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
20238 __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20251 __Pyx_WriteUnraisable(
"View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20253 __Pyx_TraceReturn(Py_None, 1);
20264 static void __pyx_memoryview__slice_assign_scalar(
char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides,
int __pyx_v_ndim,
size_t __pyx_v_itemsize,
void *__pyx_v_item) {
20265 CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20266 Py_ssize_t __pyx_v_stride;
20267 Py_ssize_t __pyx_v_extent;
20268 __Pyx_TraceDeclarations
20270 Py_ssize_t __pyx_t_2;
20271 Py_ssize_t __pyx_t_3;
20272 Py_ssize_t __pyx_t_4;
20273 int __pyx_lineno = 0;
20274 const char *__pyx_filename = NULL;
20275 int __pyx_clineno = 0;
20276 __Pyx_TraceCall(
"_slice_assign_scalar", __pyx_f[1], 1407, 1, __PYX_ERR(1, 1407, __pyx_L1_error));
20285 __Pyx_TraceLine(1411,1,__PYX_ERR(1, 1411, __pyx_L1_error))
20286 __pyx_v_stride = (__pyx_v_strides[0]);
20295 __Pyx_TraceLine(1412,1,__PYX_ERR(1, 1412, __pyx_L1_error))
20296 __pyx_v_extent = (__pyx_v_shape[0]);
20305 __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
20306 __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20316 __Pyx_TraceLine(1415,1,__PYX_ERR(1, 1415, __pyx_L1_error))
20317 __pyx_t_2 = __pyx_v_extent;
20318 __pyx_t_3 = __pyx_t_2;
20319 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20320 __pyx_v_i = __pyx_t_4;
20329 __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
20330 (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20339 __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
20340 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20360 __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
20362 __pyx_t_2 = __pyx_v_extent;
20363 __pyx_t_3 = __pyx_t_2;
20364 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20365 __pyx_v_i = __pyx_t_4;
20374 __Pyx_TraceLine(1420,1,__PYX_ERR(1, 1420, __pyx_L1_error))
20375 __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20384 __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
20385 __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20401 __Pyx_WriteUnraisable(
"View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20403 __Pyx_TraceReturn(Py_None, 1);
20413 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
20414 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {
"__pyx_unpickle_Enum", (PyCFunction)(
void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20415 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20416 PyObject *__pyx_v___pyx_type = 0;
20417 long __pyx_v___pyx_checksum;
20418 PyObject *__pyx_v___pyx_state = 0;
20419 int __pyx_lineno = 0;
20420 const char *__pyx_filename = NULL;
20421 int __pyx_clineno = 0;
20422 PyObject *__pyx_r = 0;
20423 __Pyx_RefNannyDeclarations
20424 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum (wrapper)", 0);
20426 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20427 PyObject* values[3] = {0,0,0};
20428 if (unlikely(__pyx_kwds)) {
20429 Py_ssize_t kw_args;
20430 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20431 switch (pos_args) {
20432 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20433 CYTHON_FALLTHROUGH;
20434 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20435 CYTHON_FALLTHROUGH;
20436 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20437 CYTHON_FALLTHROUGH;
20439 default:
goto __pyx_L5_argtuple_error;
20441 kw_args = PyDict_Size(__pyx_kwds);
20442 switch (pos_args) {
20444 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20445 else goto __pyx_L5_argtuple_error;
20446 CYTHON_FALLTHROUGH;
20448 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20450 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20452 CYTHON_FALLTHROUGH;
20454 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20456 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20459 if (unlikely(kw_args > 0)) {
20460 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20462 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20463 goto __pyx_L5_argtuple_error;
20465 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20466 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20467 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20469 __pyx_v___pyx_type = values[0];
20470 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]);
if (unlikely((__pyx_v___pyx_checksum == (
long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20471 __pyx_v___pyx_state = values[2];
20473 goto __pyx_L4_argument_unpacking_done;
20474 __pyx_L5_argtuple_error:;
20475 __Pyx_RaiseArgtupleInvalid(
"__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20477 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20478 __Pyx_RefNannyFinishContext();
20480 __pyx_L4_argument_unpacking_done:;
20481 __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20484 __Pyx_RefNannyFinishContext();
20488 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type,
long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20489 PyObject *__pyx_v___pyx_PickleError = 0;
20490 PyObject *__pyx_v___pyx_result = 0;
20491 PyObject *__pyx_r = NULL;
20492 __Pyx_TraceDeclarations
20493 __Pyx_RefNannyDeclarations
20495 PyObject *__pyx_t_2 = NULL;
20496 PyObject *__pyx_t_3 = NULL;
20497 PyObject *__pyx_t_4 = NULL;
20498 PyObject *__pyx_t_5 = NULL;
20500 int __pyx_lineno = 0;
20501 const char *__pyx_filename = NULL;
20502 int __pyx_clineno = 0;
20503 __Pyx_TraceFrameInit(__pyx_codeobj__36)
20504 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum", 0);
20505 __Pyx_TraceCall(
"__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20514 __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
20515 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20525 __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
20526 __pyx_t_2 = PyList_New(1);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20527 __Pyx_GOTREF(__pyx_t_2);
20528 __Pyx_INCREF(__pyx_n_s_PickleError);
20529 __Pyx_GIVEREF(__pyx_n_s_PickleError);
20530 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20531 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0);
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20532 __Pyx_GOTREF(__pyx_t_3);
20533 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20534 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20535 __Pyx_GOTREF(__pyx_t_2);
20536 __Pyx_INCREF(__pyx_t_2);
20537 __pyx_v___pyx_PickleError = __pyx_t_2;
20538 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20539 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20548 __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
20549 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
20550 __Pyx_GOTREF(__pyx_t_2);
20551 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2);
if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20552 __Pyx_GOTREF(__pyx_t_4);
20553 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20554 __Pyx_INCREF(__pyx_v___pyx_PickleError);
20555 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20556 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20557 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20558 if (likely(__pyx_t_5)) {
20559 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
20560 __Pyx_INCREF(__pyx_t_5);
20561 __Pyx_INCREF(
function);
20562 __Pyx_DECREF_SET(__pyx_t_2,
function);
20565 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
20566 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20567 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20568 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
20569 __Pyx_GOTREF(__pyx_t_3);
20570 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20571 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20572 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20573 __PYX_ERR(1, 6, __pyx_L1_error)
20591 __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
20592 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
20593 __Pyx_GOTREF(__pyx_t_2);
20595 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20596 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
20597 if (likely(__pyx_t_4)) {
20598 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
20599 __Pyx_INCREF(__pyx_t_4);
20600 __Pyx_INCREF(
function);
20601 __Pyx_DECREF_SET(__pyx_t_2,
function);
20604 __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
20605 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20606 if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
20607 __Pyx_GOTREF(__pyx_t_3);
20608 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20609 __pyx_v___pyx_result = __pyx_t_3;
20619 __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
20620 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20621 __pyx_t_6 = (__pyx_t_1 != 0);
20631 __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
20632 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20633 __pyx_t_3 = __pyx_unpickle_Enum__set_state(((
struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state));
if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
20634 __Pyx_GOTREF(__pyx_t_3);
20635 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20653 __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
20654 __Pyx_XDECREF(__pyx_r);
20655 __Pyx_INCREF(__pyx_v___pyx_result);
20656 __pyx_r = __pyx_v___pyx_result;
20667 __Pyx_XDECREF(__pyx_t_2);
20668 __Pyx_XDECREF(__pyx_t_3);
20669 __Pyx_XDECREF(__pyx_t_4);
20670 __Pyx_XDECREF(__pyx_t_5);
20671 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20674 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20675 __Pyx_XDECREF(__pyx_v___pyx_result);
20676 __Pyx_XGIVEREF(__pyx_r);
20677 __Pyx_TraceReturn(__pyx_r, 0);
20678 __Pyx_RefNannyFinishContext();
20690 static PyObject *__pyx_unpickle_Enum__set_state(
struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20691 PyObject *__pyx_r = NULL;
20692 __Pyx_TraceDeclarations
20693 __Pyx_RefNannyDeclarations
20694 PyObject *__pyx_t_1 = NULL;
20696 Py_ssize_t __pyx_t_3;
20699 PyObject *__pyx_t_6 = NULL;
20700 PyObject *__pyx_t_7 = NULL;
20701 PyObject *__pyx_t_8 = NULL;
20702 int __pyx_lineno = 0;
20703 const char *__pyx_filename = NULL;
20704 int __pyx_clineno = 0;
20705 __Pyx_RefNannySetupContext(
"__pyx_unpickle_Enum__set_state", 0);
20706 __Pyx_TraceCall(
"__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
20715 __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
20716 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20717 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20718 __PYX_ERR(1, 12, __pyx_L1_error)
20720 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20721 __Pyx_GOTREF(__pyx_t_1);
20722 __Pyx_GIVEREF(__pyx_t_1);
20723 __Pyx_GOTREF(__pyx_v___pyx_result->name);
20724 __Pyx_DECREF(__pyx_v___pyx_result->name);
20725 __pyx_v___pyx_result->name = __pyx_t_1;
20734 __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
20735 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20736 PyErr_SetString(PyExc_TypeError,
"object of type 'NoneType' has no len()");
20737 __PYX_ERR(1, 13, __pyx_L1_error)
20739 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state);
if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20740 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20743 __pyx_t_2 = __pyx_t_4;
20744 goto __pyx_L4_bool_binop_done;
20746 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(__pyx_t_4 == ((
int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20747 __pyx_t_5 = (__pyx_t_4 != 0);
20748 __pyx_t_2 = __pyx_t_5;
20749 __pyx_L4_bool_binop_done:;
20757 __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
20758 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20759 __Pyx_GOTREF(__pyx_t_6);
20760 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update);
if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
20761 __Pyx_GOTREF(__pyx_t_7);
20762 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20763 if (unlikely(__pyx_v___pyx_state == Py_None)) {
20764 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
20765 __PYX_ERR(1, 14, __pyx_L1_error)
20767 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 0);
if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20768 __Pyx_GOTREF(__pyx_t_6);
20770 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20771 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20772 if (likely(__pyx_t_8)) {
20773 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_7);
20774 __Pyx_INCREF(__pyx_t_8);
20775 __Pyx_INCREF(
function);
20776 __Pyx_DECREF_SET(__pyx_t_7,
function);
20779 __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
20780 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20781 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20782 if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
20783 __Pyx_GOTREF(__pyx_t_1);
20784 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20785 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20804 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20807 __Pyx_XDECREF(__pyx_t_1);
20808 __Pyx_XDECREF(__pyx_t_6);
20809 __Pyx_XDECREF(__pyx_t_7);
20810 __Pyx_XDECREF(__pyx_t_8);
20811 __Pyx_AddTraceback(
"View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20814 __Pyx_XGIVEREF(__pyx_r);
20815 __Pyx_TraceReturn(__pyx_r, 0);
20816 __Pyx_RefNannyFinishContext();
20819 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
20821 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
20822 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p;
20823 PyObject *o = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_new(t, a, k);
20824 if (unlikely(!o))
return 0;
20825 p = ((
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o);
20826 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
20827 p->A_csr = Py_None; Py_INCREF(Py_None);
20828 p->A_indices_copy = Py_None; Py_INCREF(Py_None);
20829 p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
20830 if (unlikely(__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(o, a, k) < 0))
goto bad;
20833 Py_DECREF(o); o = 0;
20837 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
20838 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
20839 #if CYTHON_USE_TP_FINALIZE
20840 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20841 if (PyObject_CallFinalizerFromDealloc(o))
return;
20844 PyObject_GC_UnTrack(o);
20845 Py_CLEAR(p->A_csr);
20846 Py_CLEAR(p->A_indices_copy);
20847 Py_CLEAR(p->A_index_pointer_copy);
20848 PyObject_GC_Track(o);
20849 if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dealloc(o);
else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
20852 static int __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o, visitproc v,
void *a) {
20854 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
20855 e = ((likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) ? ((__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse) ? __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix));
if (e)
return e;
20857 e = (*v)(p->A_csr, a);
if (e)
return e;
20859 if (p->A_indices_copy) {
20860 e = (*v)(p->A_indices_copy, a);
if (e)
return e;
20862 if (p->A_index_pointer_copy) {
20863 e = (*v)(p->A_index_pointer_copy, a);
if (e)
return e;
20868 static int __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
20870 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
20871 if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) {
if (__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear(o); }
else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
20872 tmp = ((PyObject*)p->A_csr);
20873 p->A_csr = Py_None; Py_INCREF(Py_None);
20875 tmp = ((PyObject*)p->A_indices_copy);
20876 p->A_indices_copy = Py_None; Py_INCREF(Py_None);
20878 tmp = ((PyObject*)p->A_index_pointer_copy);
20879 p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
20884 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix[] = {
20885 {
"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float},
20886 {
"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double},
20887 {
"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double},
20888 {
"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float},
20889 {
"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double},
20890 {
"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double},
20891 {
"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float},
20892 {
"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double},
20893 {
"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double},
20894 {
"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__},
20895 {
"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__},
20899 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = {
20900 PyVarObject_HEAD_INIT(0, 0)
20901 "imate._c_linear_operator.py_c_matrix.pycMatrix",
20902 sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix),
20904 __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
20905 #
if PY_VERSION_HEX < 0x030800b4
20908 #
if PY_VERSION_HEX >= 0x030800b4
20913 #
if PY_MAJOR_VERSION < 3
20916 #
if PY_MAJOR_VERSION >= 3
20929 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
20930 "\n Defines a linear operator that is a constant matrix.\n\n **Initializing Object:**\n\n The object is initialized by a given matrix :math:`\\mathbf{A}` which can\n be a numpy array, or sparse matrices of any format (CSR, CSC, etc) using\n scipy sparse module.\n\n .. note::\n\n Initializing the linear operator requires python's GIL. Also, the\n following examples should be used in a ``*.pyx`` file and should be\n compiled as cython's extension module.\n\n In the following example, we create the object ``Aop`` based on\n scipy.sparse matrix of CSR format. Note the format of the input matrix\n can also be anything other than ``'csr'``, such as ``'csc'``.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import scipy.sparse\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = scipy.sparse.random(n, m, format='csr')\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n\n The following is an example of defining the operator with a dense matrix:\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import numpy\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> cdef ConstantMatrix A = numpy.random.randn((n, m), dtype=float)\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n **Matrix-Vector Multiplications:**\n\n The linear operator can perform matrix vector multiplication using\n :func:`dot` function and the matrix-vector multiplication with the\n transposed matrix using :func:`transpose_dot` function.\n\n .. note::\n\n Matrix-vector multiplication using :func:`dot` and\n :func:`transpose_dot` functions do n""ot require python's GIL, hence,\n they can be called in a ``nogil`` environment, if desired.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> # Create a vectors as cython's memoryview to numpy arrays\n >>> import numpy\n >>> cdef double[:] b = numpy.random.randn(m)\n >>> cdef double[:] c = numpy.empty((n, 1), dtype=float)\n\n >>> # Perform product on vector b and store the product on vector c\n >>> with nogil:\n ... Aop.dot(&b[0], &c[0])\n\n >>> # Perform product using the transpose of the operator\n >>> with nogil:\n >>> Aop.transpose_dot(&b[0], &c[0])\n\n .. seealso::\n\n :class:`AffineMatrixFunction`\n ",
20931 __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
20932 __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
20937 __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
20947 __pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix,
20957 #
if PY_VERSION_HEX >= 0x030400a1
20960 #
if PY_VERSION_HEX >= 0x030800b1
20963 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20967 static struct __pyx_vtabstruct_array __pyx_vtable_array;
20969 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
20970 struct __pyx_array_obj *p;
20972 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20973 o = (*t->tp_alloc)(t, 0);
20975 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20977 if (unlikely(!o))
return 0;
20978 p = ((
struct __pyx_array_obj *)o);
20979 p->__pyx_vtab = __pyx_vtabptr_array;
20980 p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
20981 p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
20982 if (unlikely(__pyx_array___cinit__(o, a, k) < 0))
goto bad;
20985 Py_DECREF(o); o = 0;
20989 static void __pyx_tp_dealloc_array(PyObject *o) {
20990 struct __pyx_array_obj *p = (
struct __pyx_array_obj *)o;
20991 #if CYTHON_USE_TP_FINALIZE
20992 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
20993 if (PyObject_CallFinalizerFromDealloc(o))
return;
20997 PyObject *etype, *eval, *etb;
20998 PyErr_Fetch(&etype, &eval, &etb);
20999 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21000 __pyx_array___dealloc__(o);
21001 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21002 PyErr_Restore(etype, eval, etb);
21005 Py_CLEAR(p->_format);
21006 (*Py_TYPE(o)->tp_free)(o);
21008 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21010 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21011 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21016 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21018 return __pyx_array___setitem__(o, i, v);
21021 PyErr_Format(PyExc_NotImplementedError,
21022 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21027 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21028 PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21029 if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21031 v = __pyx_array___getattr__(o, n);
21036 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED
void *x) {
21037 return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21040 static PyMethodDef __pyx_methods_array[] = {
21041 {
"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21042 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21043 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21047 static struct PyGetSetDef __pyx_getsets_array[] = {
21048 {(
char *)
"memview", __pyx_getprop___pyx_array_memview, 0, (
char *)0, 0},
21052 static PySequenceMethods __pyx_tp_as_sequence_array = {
21053 __pyx_array___len__,
21056 __pyx_sq_item_array,
21065 static PyMappingMethods __pyx_tp_as_mapping_array = {
21066 __pyx_array___len__,
21067 __pyx_array___getitem__,
21068 __pyx_mp_ass_subscript_array,
21071 static PyBufferProcs __pyx_tp_as_buffer_array = {
21072 #if PY_MAJOR_VERSION < 3
21075 #if PY_MAJOR_VERSION < 3
21078 #if PY_MAJOR_VERSION < 3
21081 #if PY_MAJOR_VERSION < 3
21084 __pyx_array_getbuffer,
21088 static PyTypeObject __pyx_type___pyx_array = {
21089 PyVarObject_HEAD_INIT(0, 0)
21090 "imate._c_linear_operator.py_c_matrix.array",
21091 sizeof(
struct __pyx_array_obj),
21093 __pyx_tp_dealloc_array,
21094 #
if PY_VERSION_HEX < 0x030800b4
21097 #
if PY_VERSION_HEX >= 0x030800b4
21102 #
if PY_MAJOR_VERSION < 3
21105 #
if PY_MAJOR_VERSION >= 3
21110 &__pyx_tp_as_sequence_array,
21111 &__pyx_tp_as_mapping_array,
21115 __pyx_tp_getattro_array,
21117 &__pyx_tp_as_buffer_array,
21118 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
21126 __pyx_methods_array,
21128 __pyx_getsets_array,
21136 __pyx_tp_new_array,
21146 #
if PY_VERSION_HEX >= 0x030400a1
21149 #
if PY_VERSION_HEX >= 0x030800b1
21152 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21157 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21158 struct __pyx_MemviewEnum_obj *p;
21160 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21161 o = (*t->tp_alloc)(t, 0);
21163 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21165 if (unlikely(!o))
return 0;
21166 p = ((
struct __pyx_MemviewEnum_obj *)o);
21167 p->name = Py_None; Py_INCREF(Py_None);
21171 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21172 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21173 #if CYTHON_USE_TP_FINALIZE
21174 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21175 if (PyObject_CallFinalizerFromDealloc(o))
return;
21178 PyObject_GC_UnTrack(o);
21180 (*Py_TYPE(o)->tp_free)(o);
21183 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v,
void *a) {
21185 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21187 e = (*v)(p->name, a);
if (e)
return e;
21192 static int __pyx_tp_clear_Enum(PyObject *o) {
21194 struct __pyx_MemviewEnum_obj *p = (
struct __pyx_MemviewEnum_obj *)o;
21195 tmp = ((PyObject*)p->name);
21196 p->name = Py_None; Py_INCREF(Py_None);
21201 static PyMethodDef __pyx_methods_Enum[] = {
21202 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21203 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21207 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21208 PyVarObject_HEAD_INIT(0, 0)
21209 "imate._c_linear_operator.py_c_matrix.Enum",
21210 sizeof(
struct __pyx_MemviewEnum_obj),
21212 __pyx_tp_dealloc_Enum,
21213 #
if PY_VERSION_HEX < 0x030800b4
21216 #
if PY_VERSION_HEX >= 0x030800b4
21221 #
if PY_MAJOR_VERSION < 3
21224 #
if PY_MAJOR_VERSION >= 3
21227 __pyx_MemviewEnum___repr__,
21237 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21239 __pyx_tp_traverse_Enum,
21240 __pyx_tp_clear_Enum,
21245 __pyx_methods_Enum,
21253 __pyx_MemviewEnum___init__,
21265 #
if PY_VERSION_HEX >= 0x030400a1
21268 #
if PY_VERSION_HEX >= 0x030800b1
21271 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21275 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21277 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21278 struct __pyx_memoryview_obj *p;
21280 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21281 o = (*t->tp_alloc)(t, 0);
21283 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21285 if (unlikely(!o))
return 0;
21286 p = ((
struct __pyx_memoryview_obj *)o);
21287 p->__pyx_vtab = __pyx_vtabptr_memoryview;
21288 p->obj = Py_None; Py_INCREF(Py_None);
21289 p->_size = Py_None; Py_INCREF(Py_None);
21290 p->_array_interface = Py_None; Py_INCREF(Py_None);
21291 p->view.obj = NULL;
21292 if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0))
goto bad;
21295 Py_DECREF(o); o = 0;
21299 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21300 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21301 #if CYTHON_USE_TP_FINALIZE
21302 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21303 if (PyObject_CallFinalizerFromDealloc(o))
return;
21306 PyObject_GC_UnTrack(o);
21308 PyObject *etype, *eval, *etb;
21309 PyErr_Fetch(&etype, &eval, &etb);
21310 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21311 __pyx_memoryview___dealloc__(o);
21312 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21313 PyErr_Restore(etype, eval, etb);
21316 Py_CLEAR(p->_size);
21317 Py_CLEAR(p->_array_interface);
21318 (*Py_TYPE(o)->tp_free)(o);
21321 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v,
void *a) {
21323 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21325 e = (*v)(p->obj, a);
if (e)
return e;
21328 e = (*v)(p->_size, a);
if (e)
return e;
21330 if (p->_array_interface) {
21331 e = (*v)(p->_array_interface, a);
if (e)
return e;
21334 e = (*v)(p->view.obj, a);
if (e)
return e;
21339 static int __pyx_tp_clear_memoryview(PyObject *o) {
21341 struct __pyx_memoryview_obj *p = (
struct __pyx_memoryview_obj *)o;
21342 tmp = ((PyObject*)p->obj);
21343 p->obj = Py_None; Py_INCREF(Py_None);
21345 tmp = ((PyObject*)p->_size);
21346 p->_size = Py_None; Py_INCREF(Py_None);
21348 tmp = ((PyObject*)p->_array_interface);
21349 p->_array_interface = Py_None; Py_INCREF(Py_None);
21351 Py_CLEAR(p->view.obj);
21354 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21356 PyObject *x = PyInt_FromSsize_t(i);
if(!x)
return 0;
21357 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21362 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21364 return __pyx_memoryview___setitem__(o, i, v);
21367 PyErr_Format(PyExc_NotImplementedError,
21368 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21373 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED
void *x) {
21374 return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21377 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED
void *x) {
21378 return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21381 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED
void *x) {
21382 return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21385 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED
void *x) {
21386 return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21389 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED
void *x) {
21390 return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21393 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED
void *x) {
21394 return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21397 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED
void *x) {
21398 return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21401 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED
void *x) {
21402 return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21405 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED
void *x) {
21406 return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21409 static PyMethodDef __pyx_methods_memoryview[] = {
21410 {
"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21411 {
"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21412 {
"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21413 {
"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21414 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21415 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21419 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21420 {(
char *)
"T", __pyx_getprop___pyx_memoryview_T, 0, (
char *)0, 0},
21421 {(
char *)
"base", __pyx_getprop___pyx_memoryview_base, 0, (
char *)0, 0},
21422 {(
char *)
"shape", __pyx_getprop___pyx_memoryview_shape, 0, (
char *)0, 0},
21423 {(
char *)
"strides", __pyx_getprop___pyx_memoryview_strides, 0, (
char *)0, 0},
21424 {(
char *)
"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (
char *)0, 0},
21425 {(
char *)
"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (
char *)0, 0},
21426 {(
char *)
"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (
char *)0, 0},
21427 {(
char *)
"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (
char *)0, 0},
21428 {(
char *)
"size", __pyx_getprop___pyx_memoryview_size, 0, (
char *)0, 0},
21432 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21433 __pyx_memoryview___len__,
21436 __pyx_sq_item_memoryview,
21445 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21446 __pyx_memoryview___len__,
21447 __pyx_memoryview___getitem__,
21448 __pyx_mp_ass_subscript_memoryview,
21451 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21452 #if PY_MAJOR_VERSION < 3
21455 #if PY_MAJOR_VERSION < 3
21458 #if PY_MAJOR_VERSION < 3
21461 #if PY_MAJOR_VERSION < 3
21464 __pyx_memoryview_getbuffer,
21468 static PyTypeObject __pyx_type___pyx_memoryview = {
21469 PyVarObject_HEAD_INIT(0, 0)
21470 "imate._c_linear_operator.py_c_matrix.memoryview",
21471 sizeof(
struct __pyx_memoryview_obj),
21473 __pyx_tp_dealloc_memoryview,
21474 #
if PY_VERSION_HEX < 0x030800b4
21477 #
if PY_VERSION_HEX >= 0x030800b4
21482 #
if PY_MAJOR_VERSION < 3
21485 #
if PY_MAJOR_VERSION >= 3
21488 __pyx_memoryview___repr__,
21490 &__pyx_tp_as_sequence_memoryview,
21491 &__pyx_tp_as_mapping_memoryview,
21494 __pyx_memoryview___str__,
21497 &__pyx_tp_as_buffer_memoryview,
21498 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21500 __pyx_tp_traverse_memoryview,
21501 __pyx_tp_clear_memoryview,
21506 __pyx_methods_memoryview,
21508 __pyx_getsets_memoryview,
21516 __pyx_tp_new_memoryview,
21526 #
if PY_VERSION_HEX >= 0x030400a1
21529 #
if PY_VERSION_HEX >= 0x030800b1
21532 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21536 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21538 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21539 struct __pyx_memoryviewslice_obj *p;
21540 PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21541 if (unlikely(!o))
return 0;
21542 p = ((
struct __pyx_memoryviewslice_obj *)o);
21543 p->__pyx_base.__pyx_vtab = (
struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21544 p->from_object = Py_None; Py_INCREF(Py_None);
21545 p->from_slice.memview = NULL;
21549 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21550 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21551 #if CYTHON_USE_TP_FINALIZE
21552 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21553 if (PyObject_CallFinalizerFromDealloc(o))
return;
21556 PyObject_GC_UnTrack(o);
21558 PyObject *etype, *eval, *etb;
21559 PyErr_Fetch(&etype, &eval, &etb);
21560 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21561 __pyx_memoryviewslice___dealloc__(o);
21562 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21563 PyErr_Restore(etype, eval, etb);
21565 Py_CLEAR(p->from_object);
21566 PyObject_GC_Track(o);
21567 __pyx_tp_dealloc_memoryview(o);
21570 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v,
void *a) {
21572 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21573 e = __pyx_tp_traverse_memoryview(o, v, a);
if (e)
return e;
21574 if (p->from_object) {
21575 e = (*v)(p->from_object, a);
if (e)
return e;
21580 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21582 struct __pyx_memoryviewslice_obj *p = (
struct __pyx_memoryviewslice_obj *)o;
21583 __pyx_tp_clear_memoryview(o);
21584 tmp = ((PyObject*)p->from_object);
21585 p->from_object = Py_None; Py_INCREF(Py_None);
21587 __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21591 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED
void *x) {
21592 return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21595 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21596 {
"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21597 {
"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21601 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21602 {(
char *)
"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (
char *)0, 0},
21606 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21607 PyVarObject_HEAD_INIT(0, 0)
21608 "imate._c_linear_operator.py_c_matrix._memoryviewslice",
21609 sizeof(
struct __pyx_memoryviewslice_obj),
21611 __pyx_tp_dealloc__memoryviewslice,
21612 #
if PY_VERSION_HEX < 0x030800b4
21615 #
if PY_VERSION_HEX >= 0x030800b4
21620 #
if PY_MAJOR_VERSION < 3
21623 #
if PY_MAJOR_VERSION >= 3
21626 #
if CYTHON_COMPILING_IN_PYPY
21627 __pyx_memoryview___repr__,
21636 #
if CYTHON_COMPILING_IN_PYPY
21637 __pyx_memoryview___str__,
21644 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
21645 "Internal class for passing memoryview slices to Python",
21646 __pyx_tp_traverse__memoryviewslice,
21647 __pyx_tp_clear__memoryviewslice,
21652 __pyx_methods__memoryviewslice,
21654 __pyx_getsets__memoryviewslice,
21662 __pyx_tp_new__memoryviewslice,
21672 #
if PY_VERSION_HEX >= 0x030400a1
21675 #
if PY_VERSION_HEX >= 0x030800b1
21678 #
if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21683 static PyMethodDef __pyx_methods[] = {
21687 #if PY_MAJOR_VERSION >= 3
21688 #if CYTHON_PEP489_MULTI_PHASE_INIT
21689 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def);
21690 static int __pyx_pymod_exec_py_c_matrix(PyObject* module);
21691 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21692 {Py_mod_create, (
void*)__pyx_pymod_create},
21693 {Py_mod_exec, (
void*)__pyx_pymod_exec_py_c_matrix},
21698 static struct PyModuleDef __pyx_moduledef = {
21699 PyModuleDef_HEAD_INIT,
21702 #if CYTHON_PEP489_MULTI_PHASE_INIT
21708 #if CYTHON_PEP489_MULTI_PHASE_INIT
21709 __pyx_moduledef_slots,
21718 #ifndef CYTHON_SMALL_CODE
21719 #if defined(__clang__)
21720 #define CYTHON_SMALL_CODE
21721 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
21722 #define CYTHON_SMALL_CODE __attribute__((cold))
21724 #define CYTHON_SMALL_CODE
21728 static __Pyx_StringTabEntry __pyx_string_tab[] = {
21729 {&__pyx_n_s_A, __pyx_k_A,
sizeof(__pyx_k_A), 0, 0, 1, 1},
21730 {&__pyx_n_s_ASCII, __pyx_k_ASCII,
sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
21731 {&__pyx_kp_u_A_cannot_be_None, __pyx_k_A_cannot_be_None,
sizeof(__pyx_k_A_cannot_be_None), 0, 1, 0, 0},
21732 {&__pyx_n_s_A_data_double, __pyx_k_A_data_double,
sizeof(__pyx_k_A_data_double), 0, 0, 1, 1},
21733 {&__pyx_n_s_A_data_double_mv, __pyx_k_A_data_double_mv,
sizeof(__pyx_k_A_data_double_mv), 0, 0, 1, 1},
21734 {&__pyx_n_s_A_data_double_mv_c, __pyx_k_A_data_double_mv_c,
sizeof(__pyx_k_A_data_double_mv_c), 0, 0, 1, 1},
21735 {&__pyx_n_s_A_data_double_mv_f, __pyx_k_A_data_double_mv_f,
sizeof(__pyx_k_A_data_double_mv_f), 0, 0, 1, 1},
21736 {&__pyx_n_s_A_data_float, __pyx_k_A_data_float,
sizeof(__pyx_k_A_data_float), 0, 0, 1, 1},
21737 {&__pyx_n_s_A_data_float_mv, __pyx_k_A_data_float_mv,
sizeof(__pyx_k_A_data_float_mv), 0, 0, 1, 1},
21738 {&__pyx_n_s_A_data_float_mv_c, __pyx_k_A_data_float_mv_c,
sizeof(__pyx_k_A_data_float_mv_c), 0, 0, 1, 1},
21739 {&__pyx_n_s_A_data_float_mv_f, __pyx_k_A_data_float_mv_f,
sizeof(__pyx_k_A_data_float_mv_f), 0, 0, 1, 1},
21740 {&__pyx_n_s_A_data_long_double, __pyx_k_A_data_long_double,
sizeof(__pyx_k_A_data_long_double), 0, 0, 1, 1},
21741 {&__pyx_n_s_A_data_long_double_mv, __pyx_k_A_data_long_double_mv,
sizeof(__pyx_k_A_data_long_double_mv), 0, 0, 1, 1},
21742 {&__pyx_n_s_A_data_long_double_mv_c, __pyx_k_A_data_long_double_mv_c,
sizeof(__pyx_k_A_data_long_double_mv_c), 0, 0, 1, 1},
21743 {&__pyx_n_s_A_data_long_double_mv_f, __pyx_k_A_data_long_double_mv_f,
sizeof(__pyx_k_A_data_long_double_mv_f), 0, 0, 1, 1},
21744 {&__pyx_n_s_A_index_pointer, __pyx_k_A_index_pointer,
sizeof(__pyx_k_A_index_pointer), 0, 0, 1, 1},
21745 {&__pyx_n_s_A_index_pointer_mv, __pyx_k_A_index_pointer_mv,
sizeof(__pyx_k_A_index_pointer_mv), 0, 0, 1, 1},
21746 {&__pyx_n_s_A_indices, __pyx_k_A_indices,
sizeof(__pyx_k_A_indices), 0, 0, 1, 1},
21747 {&__pyx_n_s_A_indices_mv, __pyx_k_A_indices_mv,
sizeof(__pyx_k_A_indices_mv), 0, 0, 1, 1},
21748 {&__pyx_n_s_A_is_row_major, __pyx_k_A_is_row_major,
sizeof(__pyx_k_A_is_row_major), 0, 0, 1, 1},
21749 {&__pyx_n_s_A_num_columns, __pyx_k_A_num_columns,
sizeof(__pyx_k_A_num_columns), 0, 0, 1, 1},
21750 {&__pyx_n_s_A_num_rows, __pyx_k_A_num_rows,
sizeof(__pyx_k_A_num_rows), 0, 0, 1, 1},
21751 {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri,
sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
21752 {&__pyx_n_u_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS,
sizeof(__pyx_k_C_CONTIGUOUS), 0, 1, 0, 1},
21753 {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is,
sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
21754 {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor,
sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
21755 {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi,
sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
21756 {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s,
sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
21757 {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa,
sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
21758 {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis,
sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
21759 {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr,
sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
21760 {&__pyx_n_u_F_CONTIGUOUS, __pyx_k_F_CONTIGUOUS,
sizeof(__pyx_k_F_CONTIGUOUS), 0, 1, 0, 1},
21761 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0,
sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
21762 {&__pyx_n_s_IndexError, __pyx_k_IndexError,
sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
21763 {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte,
sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
21764 {&__pyx_kp_u_Input_matrix_should_be_a_2_dimen, __pyx_k_Input_matrix_should_be_a_2_dimen,
sizeof(__pyx_k_Input_matrix_should_be_a_2_dimen), 0, 1, 0, 0},
21765 {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr,
sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
21766 {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d,
sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
21767 {&__pyx_kp_u_Matrix_A_should_be_either_C_or_F, __pyx_k_Matrix_A_should_be_either_C_or_F,
sizeof(__pyx_k_Matrix_A_should_be_either_C_or_F), 0, 1, 0, 0},
21768 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError,
sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
21769 {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x,
sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
21770 {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object,
sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
21771 {&__pyx_n_b_O, __pyx_k_O,
sizeof(__pyx_k_O), 0, 0, 0, 1},
21772 {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a,
sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
21773 {&__pyx_n_s_PickleError, __pyx_k_PickleError,
sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
21774 {&__pyx_n_s_TypeError, __pyx_k_TypeError,
sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
21775 {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object,
sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
21776 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
21777 {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView,
sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
21778 {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer,
sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
21779 {&__pyx_n_s_astype, __pyx_k_astype,
sizeof(__pyx_k_astype), 0, 0, 1, 1},
21780 {&__pyx_n_s_base, __pyx_k_base,
sizeof(__pyx_k_base), 0, 0, 1, 1},
21781 {&__pyx_n_s_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 0, 1, 1},
21782 {&__pyx_n_u_c, __pyx_k_c,
sizeof(__pyx_k_c), 0, 1, 0, 1},
21783 {&__pyx_n_s_class, __pyx_k_class,
sizeof(__pyx_k_class), 0, 0, 1, 1},
21784 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback,
sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
21785 {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct,
sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
21786 {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect,
sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
21787 {&__pyx_n_s_copy, __pyx_k_copy,
sizeof(__pyx_k_copy), 0, 0, 1, 1},
21788 {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix,
sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
21789 {&__pyx_n_s_data, __pyx_k_data,
sizeof(__pyx_k_data), 0, 0, 1, 1},
21790 {&__pyx_n_s_dict, __pyx_k_dict,
sizeof(__pyx_k_dict), 0, 0, 1, 1},
21791 {&__pyx_n_s_dtype, __pyx_k_dtype,
sizeof(__pyx_k_dtype), 0, 0, 1, 1},
21792 {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object,
sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
21793 {&__pyx_n_s_encode, __pyx_k_encode,
sizeof(__pyx_k_encode), 0, 0, 1, 1},
21794 {&__pyx_n_s_enumerate, __pyx_k_enumerate,
sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
21795 {&__pyx_n_s_error, __pyx_k_error,
sizeof(__pyx_k_error), 0, 0, 1, 1},
21796 {&__pyx_n_s_flags, __pyx_k_flags,
sizeof(__pyx_k_flags), 0, 0, 1, 1},
21797 {&__pyx_n_b_float128, __pyx_k_float128,
sizeof(__pyx_k_float128), 0, 0, 0, 1},
21798 {&__pyx_n_b_float32, __pyx_k_float32,
sizeof(__pyx_k_float32), 0, 0, 0, 1},
21799 {&__pyx_n_b_float64, __pyx_k_float64,
sizeof(__pyx_k_float64), 0, 0, 0, 1},
21800 {&__pyx_n_s_format, __pyx_k_format,
sizeof(__pyx_k_format), 0, 0, 1, 1},
21801 {&__pyx_n_s_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 0, 1, 1},
21802 {&__pyx_n_u_fortran, __pyx_k_fortran,
sizeof(__pyx_k_fortran), 0, 1, 0, 1},
21803 {&__pyx_n_s_getstate, __pyx_k_getstate,
sizeof(__pyx_k_getstate), 0, 0, 1, 1},
21804 {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi,
sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
21805 {&__pyx_n_s_has_sorted_indices, __pyx_k_has_sorted_indices,
sizeof(__pyx_k_has_sorted_indices), 0, 0, 1, 1},
21806 {&__pyx_n_s_id, __pyx_k_id,
sizeof(__pyx_k_id), 0, 0, 1, 1},
21807 {&__pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_k_imate__c_linear_operator_py_c_ma,
sizeof(__pyx_k_imate__c_linear_operator_py_c_ma), 0, 0, 1, 0},
21808 {&__pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_k_imate__c_linear_operator_py_c_ma_2,
sizeof(__pyx_k_imate__c_linear_operator_py_c_ma_2), 0, 0, 1, 1},
21809 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
21810 {&__pyx_n_s_indices, __pyx_k_indices,
sizeof(__pyx_k_indices), 0, 0, 1, 1},
21811 {&__pyx_n_s_indptr, __pyx_k_indptr,
sizeof(__pyx_k_indptr), 0, 0, 1, 1},
21812 {&__pyx_n_s_issparse, __pyx_k_issparse,
sizeof(__pyx_k_issparse), 0, 0, 1, 1},
21813 {&__pyx_n_s_isspmatrix_csc, __pyx_k_isspmatrix_csc,
sizeof(__pyx_k_isspmatrix_csc), 0, 0, 1, 1},
21814 {&__pyx_n_s_isspmatrix_csr, __pyx_k_isspmatrix_csr,
sizeof(__pyx_k_isspmatrix_csr), 0, 0, 1, 1},
21815 {&__pyx_n_s_itemsize, __pyx_k_itemsize,
sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
21816 {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array,
sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
21817 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
21818 {&__pyx_n_s_memview, __pyx_k_memview,
sizeof(__pyx_k_memview), 0, 0, 1, 1},
21819 {&__pyx_n_s_mode, __pyx_k_mode,
sizeof(__pyx_k_mode), 0, 0, 1, 1},
21820 {&__pyx_n_s_name, __pyx_k_name,
sizeof(__pyx_k_name), 0, 0, 1, 1},
21821 {&__pyx_n_s_name_2, __pyx_k_name_2,
sizeof(__pyx_k_name_2), 0, 0, 1, 1},
21822 {&__pyx_n_s_ndim, __pyx_k_ndim,
sizeof(__pyx_k_ndim), 0, 0, 1, 1},
21823 {&__pyx_n_s_new, __pyx_k_new,
sizeof(__pyx_k_new), 0, 0, 1, 1},
21824 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non,
sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
21825 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
21826 {&__pyx_n_s_obj, __pyx_k_obj,
sizeof(__pyx_k_obj), 0, 0, 1, 1},
21827 {&__pyx_n_s_pack, __pyx_k_pack,
sizeof(__pyx_k_pack), 0, 0, 1, 1},
21828 {&__pyx_n_s_pickle, __pyx_k_pickle,
sizeof(__pyx_k_pickle), 0, 0, 1, 1},
21829 {&__pyx_n_s_pycMatrix, __pyx_k_pycMatrix,
sizeof(__pyx_k_pycMatrix), 0, 0, 1, 1},
21830 {&__pyx_n_s_pycMatrix___reduce_cython, __pyx_k_pycMatrix___reduce_cython,
sizeof(__pyx_k_pycMatrix___reduce_cython), 0, 0, 1, 1},
21831 {&__pyx_n_s_pycMatrix___setstate_cython, __pyx_k_pycMatrix___setstate_cython,
sizeof(__pyx_k_pycMatrix___setstate_cython), 0, 0, 1, 1},
21832 {&__pyx_n_s_pycMatrix_set_csc_matrix_double, __pyx_k_pycMatrix_set_csc_matrix_double,
sizeof(__pyx_k_pycMatrix_set_csc_matrix_double), 0, 0, 1, 1},
21833 {&__pyx_n_s_pycMatrix_set_csc_matrix_float, __pyx_k_pycMatrix_set_csc_matrix_float,
sizeof(__pyx_k_pycMatrix_set_csc_matrix_float), 0, 0, 1, 1},
21834 {&__pyx_n_s_pycMatrix_set_csc_matrix_long_do, __pyx_k_pycMatrix_set_csc_matrix_long_do,
sizeof(__pyx_k_pycMatrix_set_csc_matrix_long_do), 0, 0, 1, 1},
21835 {&__pyx_n_s_pycMatrix_set_csr_matrix_double, __pyx_k_pycMatrix_set_csr_matrix_double,
sizeof(__pyx_k_pycMatrix_set_csr_matrix_double), 0, 0, 1, 1},
21836 {&__pyx_n_s_pycMatrix_set_csr_matrix_float, __pyx_k_pycMatrix_set_csr_matrix_float,
sizeof(__pyx_k_pycMatrix_set_csr_matrix_float), 0, 0, 1, 1},
21837 {&__pyx_n_s_pycMatrix_set_csr_matrix_long_do, __pyx_k_pycMatrix_set_csr_matrix_long_do,
sizeof(__pyx_k_pycMatrix_set_csr_matrix_long_do), 0, 0, 1, 1},
21838 {&__pyx_n_s_pycMatrix_set_dense_matrix_doubl, __pyx_k_pycMatrix_set_dense_matrix_doubl,
sizeof(__pyx_k_pycMatrix_set_dense_matrix_doubl), 0, 0, 1, 1},
21839 {&__pyx_n_s_pycMatrix_set_dense_matrix_float, __pyx_k_pycMatrix_set_dense_matrix_float,
sizeof(__pyx_k_pycMatrix_set_dense_matrix_float), 0, 0, 1, 1},
21840 {&__pyx_n_s_pycMatrix_set_dense_matrix_long, __pyx_k_pycMatrix_set_dense_matrix_long,
sizeof(__pyx_k_pycMatrix_set_dense_matrix_long), 0, 0, 1, 1},
21841 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError,
sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
21842 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum,
sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
21843 {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer,
sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
21844 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result,
sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
21845 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state,
sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
21846 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type,
sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
21847 {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum,
sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
21848 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable,
sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
21849 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
21850 {&__pyx_n_s_reduce, __pyx_k_reduce,
sizeof(__pyx_k_reduce), 0, 0, 1, 1},
21851 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython,
sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
21852 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex,
sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
21853 {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse,
sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
21854 {&__pyx_n_s_self, __pyx_k_self,
sizeof(__pyx_k_self), 0, 0, 1, 1},
21855 {&__pyx_n_s_set_csc_matrix_double, __pyx_k_set_csc_matrix_double,
sizeof(__pyx_k_set_csc_matrix_double), 0, 0, 1, 1},
21856 {&__pyx_n_s_set_csc_matrix_float, __pyx_k_set_csc_matrix_float,
sizeof(__pyx_k_set_csc_matrix_float), 0, 0, 1, 1},
21857 {&__pyx_n_s_set_csc_matrix_long_double, __pyx_k_set_csc_matrix_long_double,
sizeof(__pyx_k_set_csc_matrix_long_double), 0, 0, 1, 1},
21858 {&__pyx_n_s_set_csr_matrix_double, __pyx_k_set_csr_matrix_double,
sizeof(__pyx_k_set_csr_matrix_double), 0, 0, 1, 1},
21859 {&__pyx_n_s_set_csr_matrix_float, __pyx_k_set_csr_matrix_float,
sizeof(__pyx_k_set_csr_matrix_float), 0, 0, 1, 1},
21860 {&__pyx_n_s_set_csr_matrix_long_double, __pyx_k_set_csr_matrix_long_double,
sizeof(__pyx_k_set_csr_matrix_long_double), 0, 0, 1, 1},
21861 {&__pyx_n_s_set_dense_matrix_double, __pyx_k_set_dense_matrix_double,
sizeof(__pyx_k_set_dense_matrix_double), 0, 0, 1, 1},
21862 {&__pyx_n_s_set_dense_matrix_float, __pyx_k_set_dense_matrix_float,
sizeof(__pyx_k_set_dense_matrix_float), 0, 0, 1, 1},
21863 {&__pyx_n_s_set_dense_matrix_long_double, __pyx_k_set_dense_matrix_long_double,
sizeof(__pyx_k_set_dense_matrix_long_double), 0, 0, 1, 1},
21864 {&__pyx_n_s_setstate, __pyx_k_setstate,
sizeof(__pyx_k_setstate), 0, 0, 1, 1},
21865 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython,
sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
21866 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
21867 {&__pyx_n_s_size, __pyx_k_size,
sizeof(__pyx_k_size), 0, 0, 1, 1},
21868 {&__pyx_n_s_sort_indices, __pyx_k_sort_indices,
sizeof(__pyx_k_sort_indices), 0, 0, 1, 1},
21869 {&__pyx_n_s_start, __pyx_k_start,
sizeof(__pyx_k_start), 0, 0, 1, 1},
21870 {&__pyx_n_s_step, __pyx_k_step,
sizeof(__pyx_k_step), 0, 0, 1, 1},
21871 {&__pyx_n_s_stop, __pyx_k_stop,
sizeof(__pyx_k_stop), 0, 0, 1, 1},
21872 {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct,
sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
21873 {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect,
sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
21874 {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect,
sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
21875 {&__pyx_kp_s_stringsource, __pyx_k_stringsource,
sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
21876 {&__pyx_n_s_struct, __pyx_k_struct,
sizeof(__pyx_k_struct), 0, 0, 1, 1},
21877 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
21878 {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data,
sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
21879 {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str,
sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
21880 {&__pyx_n_s_unpack, __pyx_k_unpack,
sizeof(__pyx_k_unpack), 0, 0, 1, 1},
21881 {&__pyx_n_s_update, __pyx_k_update,
sizeof(__pyx_k_update), 0, 0, 1, 1},
21882 {0, 0, 0, 0, 0, 0, 0}
21884 static CYTHON_SMALL_CODE
int __Pyx_InitCachedBuiltins(
void) {
21885 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) __PYX_ERR(0, 126, __pyx_L1_error)
21886 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError);
if (!__pyx_builtin_TypeError) __PYX_ERR(0, 142, __pyx_L1_error)
21887 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError);
if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
21888 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate);
if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
21889 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
21890 __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis);
if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
21891 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id);
if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
21892 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError);
if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
21898 static CYTHON_SMALL_CODE
int __Pyx_InitCachedConstants(
void) {
21899 __Pyx_RefNannyDeclarations
21900 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
21909 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_A_cannot_be_None);
if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 126, __pyx_L1_error)
21910 __Pyx_GOTREF(__pyx_tuple_);
21911 __Pyx_GIVEREF(__pyx_tuple_);
21920 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Input_matrix_should_be_a_2_dimen);
if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 129, __pyx_L1_error)
21921 __Pyx_GOTREF(__pyx_tuple__2);
21922 __Pyx_GIVEREF(__pyx_tuple__2);
21931 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa);
if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 142, __pyx_L1_error)
21932 __Pyx_GOTREF(__pyx_tuple__3);
21933 __Pyx_GIVEREF(__pyx_tuple__3);
21942 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Matrix_A_should_be_either_C_or_F);
if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 235, __pyx_L1_error)
21943 __Pyx_GOTREF(__pyx_tuple__5);
21944 __Pyx_GIVEREF(__pyx_tuple__5);
21952 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
21953 __Pyx_GOTREF(__pyx_tuple__15);
21954 __Pyx_GIVEREF(__pyx_tuple__15);
21961 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
21962 __Pyx_GOTREF(__pyx_tuple__17);
21963 __Pyx_GIVEREF(__pyx_tuple__17);
21972 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr);
if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 133, __pyx_L1_error)
21973 __Pyx_GOTREF(__pyx_tuple__18);
21974 __Pyx_GIVEREF(__pyx_tuple__18);
21983 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array);
if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 136, __pyx_L1_error)
21984 __Pyx_GOTREF(__pyx_tuple__19);
21985 __Pyx_GIVEREF(__pyx_tuple__19);
21994 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str);
if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 148, __pyx_L1_error)
21995 __Pyx_GOTREF(__pyx_tuple__20);
21996 __Pyx_GIVEREF(__pyx_tuple__20);
22005 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data);
if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 176, __pyx_L1_error)
22006 __Pyx_GOTREF(__pyx_tuple__21);
22007 __Pyx_GIVEREF(__pyx_tuple__21);
22016 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is);
if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 192, __pyx_L1_error)
22017 __Pyx_GOTREF(__pyx_tuple__22);
22018 __Pyx_GIVEREF(__pyx_tuple__22);
22026 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
22027 __Pyx_GOTREF(__pyx_tuple__23);
22028 __Pyx_GIVEREF(__pyx_tuple__23);
22035 __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
22036 __Pyx_GOTREF(__pyx_tuple__24);
22037 __Pyx_GIVEREF(__pyx_tuple__24);
22046 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor);
if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 418, __pyx_L1_error)
22047 __Pyx_GOTREF(__pyx_tuple__25);
22048 __Pyx_GIVEREF(__pyx_tuple__25);
22057 __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object);
if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 495, __pyx_L1_error)
22058 __Pyx_GOTREF(__pyx_tuple__26);
22059 __Pyx_GIVEREF(__pyx_tuple__26);
22068 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi);
if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 520, __pyx_L1_error)
22069 __Pyx_GOTREF(__pyx_tuple__27);
22070 __Pyx_GIVEREF(__pyx_tuple__27);
22079 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri);
if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 570, __pyx_L1_error)
22080 __Pyx_GOTREF(__pyx_tuple__28);
22081 __Pyx_GIVEREF(__pyx_tuple__28);
22090 __pyx_tuple__29 = PyTuple_New(1);
if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 577, __pyx_L1_error)
22091 __Pyx_GOTREF(__pyx_tuple__29);
22092 __Pyx_INCREF(__pyx_int_neg_1);
22093 __Pyx_GIVEREF(__pyx_int_neg_1);
22094 PyTuple_SET_ITEM(__pyx_tuple__29, 0, __pyx_int_neg_1);
22095 __Pyx_GIVEREF(__pyx_tuple__29);
22103 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
22104 __Pyx_GOTREF(__pyx_tuple__30);
22105 __Pyx_GIVEREF(__pyx_tuple__30);
22112 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
22113 __Pyx_GOTREF(__pyx_tuple__31);
22114 __Pyx_GIVEREF(__pyx_tuple__31);
22123 __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__32)) __PYX_ERR(1, 682, __pyx_L1_error)
22124 __Pyx_GOTREF(__pyx_slice__32);
22125 __Pyx_GIVEREF(__pyx_slice__32);
22134 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte);
if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 703, __pyx_L1_error)
22135 __Pyx_GOTREF(__pyx_tuple__33);
22136 __Pyx_GIVEREF(__pyx_tuple__33);
22144 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
22145 __Pyx_GOTREF(__pyx_tuple__34);
22146 __Pyx_GIVEREF(__pyx_tuple__34);
22153 __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non);
if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
22154 __Pyx_GOTREF(__pyx_tuple__35);
22155 __Pyx_GIVEREF(__pyx_tuple__35);
22164 __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_float_mv_c, __pyx_n_s_A_data_float_mv_f, __pyx_n_s_A_data_float);
if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 216, __pyx_L1_error)
22165 __Pyx_GOTREF(__pyx_tuple__37);
22166 __Pyx_GIVEREF(__pyx_tuple__37);
22167 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_float, 216, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 216, __pyx_L1_error)
22176 __pyx_tuple__38 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_double_mv_c, __pyx_n_s_A_data_double_mv_f, __pyx_n_s_A_data_double);
if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 272, __pyx_L1_error)
22177 __Pyx_GOTREF(__pyx_tuple__38);
22178 __Pyx_GIVEREF(__pyx_tuple__38);
22179 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_double, 272, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 272, __pyx_L1_error)
22188 __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_long_double_mv_c, __pyx_n_s_A_data_long_double_mv_f, __pyx_n_s_A_data_long_double);
if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 328, __pyx_L1_error)
22189 __Pyx_GOTREF(__pyx_tuple__39);
22190 __Pyx_GIVEREF(__pyx_tuple__39);
22191 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_long_double, 328, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 328, __pyx_L1_error)
22200 __pyx_tuple__40 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 384, __pyx_L1_error)
22201 __Pyx_GOTREF(__pyx_tuple__40);
22202 __Pyx_GIVEREF(__pyx_tuple__40);
22203 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_float, 384, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 384, __pyx_L1_error)
22212 __pyx_tuple__41 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 431, __pyx_L1_error)
22213 __Pyx_GOTREF(__pyx_tuple__41);
22214 __Pyx_GIVEREF(__pyx_tuple__41);
22215 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_double, 431, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 431, __pyx_L1_error)
22224 __pyx_tuple__42 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 478, __pyx_L1_error)
22225 __Pyx_GOTREF(__pyx_tuple__42);
22226 __Pyx_GIVEREF(__pyx_tuple__42);
22227 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_long_double, 478, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 478, __pyx_L1_error)
22236 __pyx_tuple__43 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 525, __pyx_L1_error)
22237 __Pyx_GOTREF(__pyx_tuple__43);
22238 __Pyx_GIVEREF(__pyx_tuple__43);
22239 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_float, 525, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 525, __pyx_L1_error)
22248 __pyx_tuple__44 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 572, __pyx_L1_error)
22249 __Pyx_GOTREF(__pyx_tuple__44);
22250 __Pyx_GIVEREF(__pyx_tuple__44);
22251 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_double, 572, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 572, __pyx_L1_error)
22260 __pyx_tuple__45 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer);
if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 619, __pyx_L1_error)
22261 __Pyx_GOTREF(__pyx_tuple__45);
22262 __Pyx_GIVEREF(__pyx_tuple__45);
22263 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_long_double, 619, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 619, __pyx_L1_error)
22270 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_self);
if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 1, __pyx_L1_error)
22271 __Pyx_GOTREF(__pyx_tuple__46);
22272 __Pyx_GIVEREF(__pyx_tuple__46);
22273 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
22281 __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state);
if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 3, __pyx_L1_error)
22282 __Pyx_GOTREF(__pyx_tuple__47);
22283 __Pyx_GIVEREF(__pyx_tuple__47);
22284 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 3, __pyx_L1_error)
22293 __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect);
if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 286, __pyx_L1_error)
22294 __Pyx_GOTREF(__pyx_tuple__48);
22295 __Pyx_GIVEREF(__pyx_tuple__48);
22304 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct);
if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 287, __pyx_L1_error)
22305 __Pyx_GOTREF(__pyx_tuple__49);
22306 __Pyx_GIVEREF(__pyx_tuple__49);
22315 __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect);
if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 288, __pyx_L1_error)
22316 __Pyx_GOTREF(__pyx_tuple__50);
22317 __Pyx_GIVEREF(__pyx_tuple__50);
22326 __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct);
if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 291, __pyx_L1_error)
22327 __Pyx_GOTREF(__pyx_tuple__51);
22328 __Pyx_GIVEREF(__pyx_tuple__51);
22337 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect);
if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 292, __pyx_L1_error)
22338 __Pyx_GOTREF(__pyx_tuple__52);
22339 __Pyx_GIVEREF(__pyx_tuple__52);
22346 __pyx_tuple__53 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result);
if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 1, __pyx_L1_error)
22347 __Pyx_GOTREF(__pyx_tuple__53);
22348 __Pyx_GIVEREF(__pyx_tuple__53);
22349 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 1, __pyx_L1_error)
22350 __Pyx_RefNannyFinishContext();
22353 __Pyx_RefNannyFinishContext();
22357 static CYTHON_SMALL_CODE
int __Pyx_InitGlobals(
void) {
22358 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22359 __pyx_int_0 = PyInt_FromLong(0);
if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22360 __pyx_int_1 = PyInt_FromLong(1);
if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22361 __pyx_int_2 = PyInt_FromLong(2);
if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
22362 __pyx_int_184977713 = PyInt_FromLong(184977713L);
if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22363 __pyx_int_neg_1 = PyInt_FromLong(-1);
if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22369 static CYTHON_SMALL_CODE
int __Pyx_modinit_global_init_code(
void);
22370 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_export_code(
void);
22371 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_export_code(
void);
22372 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_init_code(
void);
22373 static CYTHON_SMALL_CODE
int __Pyx_modinit_type_import_code(
void);
22374 static CYTHON_SMALL_CODE
int __Pyx_modinit_variable_import_code(
void);
22375 static CYTHON_SMALL_CODE
int __Pyx_modinit_function_import_code(
void);
22377 static int __Pyx_modinit_global_init_code(
void) {
22378 __Pyx_RefNannyDeclarations
22379 __Pyx_RefNannySetupContext(
"__Pyx_modinit_global_init_code", 0);
22381 generic = Py_None; Py_INCREF(Py_None);
22382 strided = Py_None; Py_INCREF(Py_None);
22383 indirect = Py_None; Py_INCREF(Py_None);
22384 contiguous = Py_None; Py_INCREF(Py_None);
22385 indirect_contiguous = Py_None; Py_INCREF(Py_None);
22386 __Pyx_RefNannyFinishContext();
22390 static int __Pyx_modinit_variable_export_code(
void) {
22391 __Pyx_RefNannyDeclarations
22392 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_export_code", 0);
22394 __Pyx_RefNannyFinishContext();
22398 static int __Pyx_modinit_function_export_code(
void) {
22399 __Pyx_RefNannyDeclarations
22400 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_export_code", 0);
22402 __Pyx_RefNannyFinishContext();
22406 static int __Pyx_modinit_type_init_code(
void) {
22407 __Pyx_RefNannyDeclarations
22408 PyObject *__pyx_t_1 = NULL;
22409 int __pyx_lineno = 0;
22410 const char *__pyx_filename = NULL;
22411 int __pyx_clineno = 0;
22412 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_init_code", 0);
22414 __pyx_t_1 = PyImport_ImportModule(
"imate._c_linear_operator.py_c_linear_operator");
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22415 __Pyx_GOTREF(__pyx_t_1);
22416 __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType(__pyx_t_1,
"imate._c_linear_operator.py_c_linear_operator",
"pycLinearOperator",
sizeof(
struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __Pyx_ImportType_CheckSize_Warn);
22417 if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(0, 1, __pyx_L1_error)
22418 __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (
struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict);
if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(0, 1, __pyx_L1_error)
22419 __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22420 __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.__pyx_base = *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22421 __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_base = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22422 if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22423 #if PY_VERSION_HEX < 0x030800B1
22424 __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_print = 0;
22426 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro == PyObject_GenericGetAttr)) {
22427 __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22429 if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22430 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycMatrix, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22431 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22432 __pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22433 __pyx_vtabptr_array = &__pyx_vtable_array;
22434 __pyx_vtable_array.get_memview = (PyObject *(*)(
struct __pyx_array_obj *))__pyx_array_get_memview;
22435 if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22436 #if PY_VERSION_HEX < 0x030800B1
22437 __pyx_type___pyx_array.tp_print = 0;
22439 if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22440 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22441 __pyx_array_type = &__pyx_type___pyx_array;
22442 if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22443 #if PY_VERSION_HEX < 0x030800B1
22444 __pyx_type___pyx_MemviewEnum.tp_print = 0;
22446 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22447 __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22449 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22450 __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22451 __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22452 __pyx_vtable_memoryview.get_item_pointer = (
char *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22453 __pyx_vtable_memoryview.is_slice = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22454 __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22455 __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(
struct __pyx_memoryview_obj *,
struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22456 __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(
struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22457 __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryview_convert_item_to_object;
22458 __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22459 if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22460 #if PY_VERSION_HEX < 0x030800B1
22461 __pyx_type___pyx_memoryview.tp_print = 0;
22463 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22464 __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22466 if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22467 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22468 __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22469 __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22470 __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22471 __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *))__pyx_memoryviewslice_convert_item_to_object;
22472 __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(
struct __pyx_memoryview_obj *,
char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22473 __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22474 if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22475 #if PY_VERSION_HEX < 0x030800B1
22476 __pyx_type___pyx_memoryviewslice.tp_print = 0;
22478 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22479 __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22481 if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22482 if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22483 __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22484 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22485 __Pyx_RefNannyFinishContext();
22488 __Pyx_XDECREF(__pyx_t_1);
22489 __Pyx_RefNannyFinishContext();
22493 static int __Pyx_modinit_type_import_code(
void) {
22494 __Pyx_RefNannyDeclarations
22495 __Pyx_RefNannySetupContext(
"__Pyx_modinit_type_import_code", 0);
22497 __Pyx_RefNannyFinishContext();
22501 static int __Pyx_modinit_variable_import_code(
void) {
22502 __Pyx_RefNannyDeclarations
22503 __Pyx_RefNannySetupContext(
"__Pyx_modinit_variable_import_code", 0);
22505 __Pyx_RefNannyFinishContext();
22509 static int __Pyx_modinit_function_import_code(
void) {
22510 __Pyx_RefNannyDeclarations
22511 __Pyx_RefNannySetupContext(
"__Pyx_modinit_function_import_code", 0);
22513 __Pyx_RefNannyFinishContext();
22518 #ifndef CYTHON_NO_PYINIT_EXPORT
22519 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22520 #elif PY_MAJOR_VERSION < 3
22522 #define __Pyx_PyMODINIT_FUNC extern "C" void
22524 #define __Pyx_PyMODINIT_FUNC void
22528 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22530 #define __Pyx_PyMODINIT_FUNC PyObject *
22535 #if PY_MAJOR_VERSION < 3
22536 __Pyx_PyMODINIT_FUNC initpy_c_matrix(
void) CYTHON_SMALL_CODE;
22537 __Pyx_PyMODINIT_FUNC initpy_c_matrix(
void)
22539 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(
void) CYTHON_SMALL_CODE;
22540 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(
void)
22541 #if CYTHON_PEP489_MULTI_PHASE_INIT
22543 return PyModuleDef_Init(&__pyx_moduledef);
22545 static CYTHON_SMALL_CODE
int __Pyx_check_single_interpreter(
void) {
22546 #if PY_VERSION_HEX >= 0x030700A1
22547 static PY_INT64_T main_interpreter_id = -1;
22548 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22549 if (main_interpreter_id == -1) {
22550 main_interpreter_id = current_id;
22551 return (unlikely(current_id == -1)) ? -1 : 0;
22552 }
else if (unlikely(main_interpreter_id != current_id))
22554 static PyInterpreterState *main_interpreter = NULL;
22555 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22556 if (!main_interpreter) {
22557 main_interpreter = current_interpreter;
22558 }
else if (unlikely(main_interpreter != current_interpreter))
22563 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22568 static CYTHON_SMALL_CODE
int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict,
const char* from_name,
const char* to_name,
int allow_none) {
22569 PyObject *value = PyObject_GetAttrString(spec, from_name);
22571 if (likely(value)) {
22572 if (allow_none || value != Py_None) {
22573 result = PyDict_SetItemString(moddict, to_name, value);
22576 }
else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22583 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22584 PyObject *module = NULL, *moddict, *modname;
22585 if (__Pyx_check_single_interpreter())
22588 return __Pyx_NewRef(__pyx_m);
22589 modname = PyObject_GetAttrString(spec,
"name");
22590 if (unlikely(!modname))
goto bad;
22591 module = PyModule_NewObject(modname);
22592 Py_DECREF(modname);
22593 if (unlikely(!module))
goto bad;
22594 moddict = PyModule_GetDict(module);
22595 if (unlikely(!moddict))
goto bad;
22596 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"loader",
"__loader__", 1) < 0))
goto bad;
22597 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"origin",
"__file__", 1) < 0))
goto bad;
22598 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"parent",
"__package__", 1) < 0))
goto bad;
22599 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict,
"submodule_search_locations",
"__path__", 0) < 0))
goto bad;
22602 Py_XDECREF(module);
22607 static CYTHON_SMALL_CODE
int __pyx_pymod_exec_py_c_matrix(PyObject *__pyx_pyinit_module)
22611 __Pyx_TraceDeclarations
22612 PyObject *__pyx_t_1 = NULL;
22613 PyObject *__pyx_t_2 = NULL;
22614 static PyThread_type_lock __pyx_t_3[8];
22615 int __pyx_lineno = 0;
22616 const char *__pyx_filename = NULL;
22617 int __pyx_clineno = 0;
22618 __Pyx_RefNannyDeclarations
22619 #if CYTHON_PEP489_MULTI_PHASE_INIT
22621 if (__pyx_m == __pyx_pyinit_module)
return 0;
22622 PyErr_SetString(PyExc_RuntimeError,
"Module 'py_c_matrix' has already been imported. Re-initialisation is not supported.");
22625 #elif PY_MAJOR_VERSION >= 3
22626 if (__pyx_m)
return __Pyx_NewRef(__pyx_m);
22628 #if CYTHON_REFNANNY
22629 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
22630 if (!__Pyx_RefNanny) {
22632 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
22633 if (!__Pyx_RefNanny)
22634 Py_FatalError(
"failed to import 'refnanny' module");
22637 __Pyx_RefNannySetupContext(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", 0);
22638 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22639 #ifdef __Pxy_PyFrame_Initialize_Offsets
22640 __Pxy_PyFrame_Initialize_Offsets();
22642 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22643 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22644 __pyx_empty_unicode = PyUnicode_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22645 #ifdef __Pyx_CyFunction_USED
22646 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22648 #ifdef __Pyx_FusedFunction_USED
22649 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22651 #ifdef __Pyx_Coroutine_USED
22652 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22654 #ifdef __Pyx_Generator_USED
22655 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22657 #ifdef __Pyx_AsyncGen_USED
22658 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22660 #ifdef __Pyx_StopAsyncIteration_USED
22661 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22665 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22666 PyEval_InitThreads();
22669 #if CYTHON_PEP489_MULTI_PHASE_INIT
22670 __pyx_m = __pyx_pyinit_module;
22671 Py_INCREF(__pyx_m);
22673 #if PY_MAJOR_VERSION < 3
22674 __pyx_m = Py_InitModule4(
"py_c_matrix", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22676 __pyx_m = PyModule_Create(&__pyx_moduledef);
22678 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
22680 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
22681 Py_INCREF(__pyx_d);
22682 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
22683 Py_INCREF(__pyx_b);
22684 __pyx_cython_runtime = PyImport_AddModule((
char *)
"cython_runtime");
if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
22685 Py_INCREF(__pyx_cython_runtime);
22686 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22688 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22689 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
22690 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22692 if (__pyx_module_is_main_imate___c_linear_operator__py_c_matrix) {
22693 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22695 #if PY_MAJOR_VERSION >= 3
22697 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
22698 if (!PyDict_GetItemString(modules,
"imate._c_linear_operator.py_c_matrix")) {
22699 if (unlikely(PyDict_SetItemString(modules,
"imate._c_linear_operator.py_c_matrix", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22704 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22706 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22708 (void)__Pyx_modinit_global_init_code();
22709 (void)__Pyx_modinit_variable_export_code();
22710 (void)__Pyx_modinit_function_export_code();
22711 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22712 (void)__Pyx_modinit_type_import_code();
22713 (void)__Pyx_modinit_variable_import_code();
22714 (void)__Pyx_modinit_function_import_code();
22716 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22717 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22719 __Pyx_TraceCall(
"__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
22728 __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
22729 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
22730 __Pyx_GOTREF(__pyx_t_1);
22731 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
22732 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22741 __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
22742 __pyx_t_1 = PyList_New(4);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
22743 __Pyx_GOTREF(__pyx_t_1);
22744 __Pyx_INCREF(__pyx_n_s_issparse);
22745 __Pyx_GIVEREF(__pyx_n_s_issparse);
22746 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_issparse);
22747 __Pyx_INCREF(__pyx_n_s_isspmatrix_csr);
22748 __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csr);
22749 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_isspmatrix_csr);
22750 __Pyx_INCREF(__pyx_n_s_isspmatrix_csc);
22751 __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csc);
22752 PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_isspmatrix_csc);
22753 __Pyx_INCREF(__pyx_n_s_csr_matrix);
22754 __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
22755 PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_csr_matrix);
22756 __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
22757 __Pyx_GOTREF(__pyx_t_2);
22758 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22759 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
22760 __Pyx_GOTREF(__pyx_t_1);
22761 if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
22762 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22763 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csr);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
22764 __Pyx_GOTREF(__pyx_t_1);
22765 if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csr, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
22766 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22767 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csc);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
22768 __Pyx_GOTREF(__pyx_t_1);
22769 if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csc, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
22770 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22771 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix);
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
22772 __Pyx_GOTREF(__pyx_t_1);
22773 if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
22774 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22775 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22784 __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
22785 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__4));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
22786 __Pyx_GOTREF(__pyx_t_2);
22787 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
22788 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22789 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22798 __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
22799 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_doubl, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__6));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
22800 __Pyx_GOTREF(__pyx_t_2);
22801 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
22802 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22803 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22812 __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error))
22813 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_long, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__7));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
22814 __Pyx_GOTREF(__pyx_t_2);
22815 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
22816 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22817 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22826 __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
22827 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__8));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
22828 __Pyx_GOTREF(__pyx_t_2);
22829 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 384, __pyx_L1_error)
22830 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22831 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22840 __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
22841 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__9));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
22842 __Pyx_GOTREF(__pyx_t_2);
22843 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 431, __pyx_L1_error)
22844 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22845 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22854 __Pyx_TraceLine(478,0,__PYX_ERR(0, 478, __pyx_L1_error))
22855 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__10));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
22856 __Pyx_GOTREF(__pyx_t_2);
22857 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
22858 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22859 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22868 __Pyx_TraceLine(525,0,__PYX_ERR(0, 525, __pyx_L1_error))
22869 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__11));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
22870 __Pyx_GOTREF(__pyx_t_2);
22871 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 525, __pyx_L1_error)
22872 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22873 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22882 __Pyx_TraceLine(572,0,__PYX_ERR(0, 572, __pyx_L1_error))
22883 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__12));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
22884 __Pyx_GOTREF(__pyx_t_2);
22885 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
22886 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22887 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22896 __Pyx_TraceLine(619,0,__PYX_ERR(0, 619, __pyx_L1_error))
22897 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__13));
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error)
22898 __Pyx_GOTREF(__pyx_t_2);
22899 if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 619, __pyx_L1_error)
22900 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22901 PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22908 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
22909 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___reduce_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__14));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
22910 __Pyx_GOTREF(__pyx_t_2);
22911 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22912 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22920 __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
22921 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___setstate_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__16));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
22922 __Pyx_GOTREF(__pyx_t_2);
22923 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
22924 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22931 __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
22932 __pyx_t_2 = __Pyx_PyDict_NewPresized(0);
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
22933 __Pyx_GOTREF(__pyx_t_2);
22934 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22935 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22944 __Pyx_TraceLine(209,0,__PYX_ERR(1, 209, __pyx_L1_error))
22945 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_array_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 209, __pyx_L1_error)
22946 __Pyx_GOTREF(__pyx_t_2);
22947 if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
22948 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22949 PyType_Modified(__pyx_array_type);
22958 __Pyx_TraceLine(226,0,__PYX_ERR(1, 226, __pyx_L1_error))
22968 __Pyx_TraceLine(244,0,__PYX_ERR(1, 244, __pyx_L1_error))
22978 __Pyx_TraceLine(286,0,__PYX_ERR(1, 286, __pyx_L1_error))
22979 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 286, __pyx_L1_error)
22980 __Pyx_GOTREF(__pyx_t_2);
22981 __Pyx_XGOTREF(
generic);
22982 __Pyx_DECREF_SET(
generic, __pyx_t_2);
22983 __Pyx_GIVEREF(__pyx_t_2);
22993 __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
22994 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
22995 __Pyx_GOTREF(__pyx_t_2);
22996 __Pyx_XGOTREF(strided);
22997 __Pyx_DECREF_SET(strided, __pyx_t_2);
22998 __Pyx_GIVEREF(__pyx_t_2);
23008 __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
23009 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
23010 __Pyx_GOTREF(__pyx_t_2);
23011 __Pyx_XGOTREF(indirect);
23012 __Pyx_DECREF_SET(indirect, __pyx_t_2);
23013 __Pyx_GIVEREF(__pyx_t_2);
23023 __Pyx_TraceLine(291,0,__PYX_ERR(1, 291, __pyx_L1_error))
23024 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error)
23025 __Pyx_GOTREF(__pyx_t_2);
23026 __Pyx_XGOTREF(contiguous);
23027 __Pyx_DECREF_SET(contiguous, __pyx_t_2);
23028 __Pyx_GIVEREF(__pyx_t_2);
23038 __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
23039 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
23040 __Pyx_GOTREF(__pyx_t_2);
23041 __Pyx_XGOTREF(indirect_contiguous);
23042 __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
23043 __Pyx_GIVEREF(__pyx_t_2);
23053 __Pyx_TraceLine(298,0,__PYX_ERR(1, 298, __pyx_L1_error))
23063 __Pyx_TraceLine(316,0,__PYX_ERR(1, 316, __pyx_L1_error))
23064 __pyx_memoryview_thread_locks_used = 0;
23073 __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
23074 __pyx_t_3[0] = PyThread_allocate_lock();
23075 __pyx_t_3[1] = PyThread_allocate_lock();
23076 __pyx_t_3[2] = PyThread_allocate_lock();
23077 __pyx_t_3[3] = PyThread_allocate_lock();
23078 __pyx_t_3[4] = PyThread_allocate_lock();
23079 __pyx_t_3[5] = PyThread_allocate_lock();
23080 __pyx_t_3[6] = PyThread_allocate_lock();
23081 __pyx_t_3[7] = PyThread_allocate_lock();
23082 memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3,
sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23091 __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
23101 __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
23111 __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
23121 __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
23131 __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L1_error))
23141 __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
23151 __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L1_error))
23161 __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
23162 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 549, __pyx_L1_error)
23163 __Pyx_GOTREF(__pyx_t_2);
23164 if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
23165 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23166 PyType_Modified(__pyx_memoryview_type);
23175 __Pyx_TraceLine(657,0,__PYX_ERR(1, 657, __pyx_L1_error))
23185 __Pyx_TraceLine(663,0,__PYX_ERR(1, 663, __pyx_L1_error))
23195 __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
23205 __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
23215 __Pyx_TraceLine(710,0,__PYX_ERR(1, 710, __pyx_L1_error))
23225 __Pyx_TraceLine(807,0,__PYX_ERR(1, 807, __pyx_L1_error))
23235 __Pyx_TraceLine(910,0,__PYX_ERR(1, 910, __pyx_L1_error))
23245 __Pyx_TraceLine(943,0,__PYX_ERR(1, 943, __pyx_L1_error))
23255 __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
23265 __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
23275 __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
23276 __pyx_t_2 = __pyx_capsule_create(((
void *)(&__pyx_memoryview_getbuffer)), ((
char *)
"getbuffer(obj, view, flags)"));
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 995, __pyx_L1_error)
23277 __Pyx_GOTREF(__pyx_t_2);
23278 if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
23279 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23280 PyType_Modified(__pyx_memoryviewslice_type);
23289 __Pyx_TraceLine(999,0,__PYX_ERR(1, 999, __pyx_L1_error))
23299 __Pyx_TraceLine(1052,0,__PYX_ERR(1, 1052, __pyx_L1_error))
23309 __Pyx_TraceLine(1063,0,__PYX_ERR(1, 1063, __pyx_L1_error))
23319 __Pyx_TraceLine(1080,0,__PYX_ERR(1, 1080, __pyx_L1_error))
23329 __Pyx_TraceLine(1087,0,__PYX_ERR(1, 1087, __pyx_L1_error))
23339 __Pyx_TraceLine(1109,0,__PYX_ERR(1, 1109, __pyx_L1_error))
23349 __Pyx_TraceLine(1116,0,__PYX_ERR(1, 1116, __pyx_L1_error))
23359 __Pyx_TraceLine(1170,0,__PYX_ERR(1, 1170, __pyx_L1_error))
23369 __Pyx_TraceLine(1177,0,__PYX_ERR(1, 1177, __pyx_L1_error))
23379 __Pyx_TraceLine(1187,0,__PYX_ERR(1, 1187, __pyx_L1_error))
23389 __Pyx_TraceLine(1208,0,__PYX_ERR(1, 1208, __pyx_L1_error))
23399 __Pyx_TraceLine(1251,0,__PYX_ERR(1, 1251, __pyx_L1_error))
23409 __Pyx_TraceLine(1257,0,__PYX_ERR(1, 1257, __pyx_L1_error))
23419 __Pyx_TraceLine(1261,0,__PYX_ERR(1, 1261, __pyx_L1_error))
23429 __Pyx_TraceLine(1268,0,__PYX_ERR(1, 1268, __pyx_L1_error))
23439 __Pyx_TraceLine(1340,0,__PYX_ERR(1, 1340, __pyx_L1_error))
23449 __Pyx_TraceLine(1362,0,__PYX_ERR(1, 1362, __pyx_L1_error))
23459 __Pyx_TraceLine(1371,0,__PYX_ERR(1, 1371, __pyx_L1_error))
23469 __Pyx_TraceLine(1377,0,__PYX_ERR(1, 1377, __pyx_L1_error))
23479 __Pyx_TraceLine(1397,0,__PYX_ERR(1, 1397, __pyx_L1_error))
23489 __Pyx_TraceLine(1407,0,__PYX_ERR(1, 1407, __pyx_L1_error))
23497 __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
23498 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView);
if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
23499 __Pyx_GOTREF(__pyx_t_2);
23500 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23501 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23510 __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
23512 __Pyx_TraceReturn(Py_None, 0);
23518 __Pyx_XDECREF(__pyx_t_1);
23519 __Pyx_XDECREF(__pyx_t_2);
23522 __Pyx_AddTraceback(
"init imate._c_linear_operator.py_c_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
23525 }
else if (!PyErr_Occurred()) {
23526 PyErr_SetString(PyExc_ImportError,
"init imate._c_linear_operator.py_c_matrix");
23529 __Pyx_RefNannyFinishContext();
23530 #if CYTHON_PEP489_MULTI_PHASE_INIT
23531 return (__pyx_m != NULL) ? 0 : -1;
23532 #elif PY_MAJOR_VERSION >= 3
23541 #if CYTHON_REFNANNY
23542 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23543 PyObject *m = NULL, *p = NULL;
23545 m = PyImport_ImportModule(modname);
23547 p = PyObject_GetAttrString(m,
"RefNannyAPI");
23549 r = PyLong_AsVoidPtr(p);
23553 return (__Pyx_RefNannyAPIStruct *)r;
23558 #if CYTHON_USE_TYPE_SLOTS
23559 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23560 PyTypeObject* tp = Py_TYPE(obj);
23561 if (likely(tp->tp_getattro))
23562 return tp->tp_getattro(obj, attr_name);
23563 #if PY_MAJOR_VERSION < 3
23564 if (likely(tp->tp_getattr))
23565 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23567 return PyObject_GetAttr(obj, attr_name);
23572 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23573 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23574 if (unlikely(!result)) {
23575 PyErr_Format(PyExc_NameError,
23576 #
if PY_MAJOR_VERSION >= 3
23577 "name '%U' is not defined", name);
23579 "name '%.200s' is not defined", PyString_AS_STRING(name));
23586 static void __Pyx_RaiseDoubleKeywordsError(
23587 const char* func_name,
23590 PyErr_Format(PyExc_TypeError,
23591 #
if PY_MAJOR_VERSION >= 3
23592 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23594 "%s() got multiple values for keyword argument '%s'", func_name,
23595 PyString_AsString(kw_name));
23600 static int __Pyx_ParseOptionalKeywords(
23602 PyObject **argnames[],
23604 PyObject *values[],
23605 Py_ssize_t num_pos_args,
23606 const char* function_name)
23608 PyObject *key = 0, *value = 0;
23609 Py_ssize_t pos = 0;
23611 PyObject*** first_kw_arg = argnames + num_pos_args;
23612 while (PyDict_Next(kwds, &pos, &key, &value)) {
23613 name = first_kw_arg;
23614 while (*name && (**name != key)) name++;
23616 values[name-argnames] = value;
23619 name = first_kw_arg;
23620 #if PY_MAJOR_VERSION < 3
23621 if (likely(PyString_Check(key))) {
23623 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23624 && _PyString_Eq(**name, key)) {
23625 values[name-argnames] = value;
23630 if (*name)
continue;
23632 PyObject*** argname = argnames;
23633 while (argname != first_kw_arg) {
23634 if ((**argname == key) || (
23635 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23636 && _PyString_Eq(**argname, key))) {
23637 goto arg_passed_twice;
23644 if (likely(PyUnicode_Check(key))) {
23646 int cmp = (**name == key) ? 0 :
23647 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23648 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23650 PyUnicode_Compare(**name, key);
23651 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23653 values[name-argnames] = value;
23658 if (*name)
continue;
23660 PyObject*** argname = argnames;
23661 while (argname != first_kw_arg) {
23662 int cmp = (**argname == key) ? 0 :
23663 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23664 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23666 PyUnicode_Compare(**argname, key);
23667 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23668 if (cmp == 0)
goto arg_passed_twice;
23673 goto invalid_keyword_type;
23675 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
23677 goto invalid_keyword;
23682 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23684 invalid_keyword_type:
23685 PyErr_Format(PyExc_TypeError,
23686 "%.200s() keywords must be strings", function_name);
23689 PyErr_Format(PyExc_TypeError,
23690 #
if PY_MAJOR_VERSION < 3
23691 "%.200s() got an unexpected keyword argument '%.200s'",
23692 function_name, PyString_AsString(key));
23694 "%s() got an unexpected keyword argument '%U'",
23695 function_name, key);
23702 static void __Pyx_RaiseArgtupleInvalid(
23703 const char* func_name,
23705 Py_ssize_t num_min,
23706 Py_ssize_t num_max,
23707 Py_ssize_t num_found)
23709 Py_ssize_t num_expected;
23710 const char *more_or_less;
23711 if (num_found < num_min) {
23712 num_expected = num_min;
23713 more_or_less =
"at least";
23715 num_expected = num_max;
23716 more_or_less =
"at most";
23719 more_or_less =
"exactly";
23721 PyErr_Format(PyExc_TypeError,
23722 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
23723 func_name, more_or_less, num_expected,
23724 (num_expected == 1) ?
"" :
"s", num_found);
23728 #if CYTHON_FAST_THREAD_STATE
23729 static CYTHON_INLINE
void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23730 PyObject *tmp_type, *tmp_value, *tmp_tb;
23731 tmp_type = tstate->curexc_type;
23732 tmp_value = tstate->curexc_value;
23733 tmp_tb = tstate->curexc_traceback;
23734 tstate->curexc_type = type;
23735 tstate->curexc_value = value;
23736 tstate->curexc_traceback = tb;
23737 Py_XDECREF(tmp_type);
23738 Py_XDECREF(tmp_value);
23739 Py_XDECREF(tmp_tb);
23741 static CYTHON_INLINE
void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23742 *type = tstate->curexc_type;
23743 *value = tstate->curexc_value;
23744 *tb = tstate->curexc_traceback;
23745 tstate->curexc_type = 0;
23746 tstate->curexc_value = 0;
23747 tstate->curexc_traceback = 0;
23753 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
23754 PyFrameObject** frame,
23755 PyThreadState* tstate,
23756 const char *funcname,
23757 const char *srcfile,
23759 PyObject *type, *value, *traceback;
23761 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
23762 if (*code == NULL) {
23763 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
23764 if (*code == NULL)
return 0;
23766 *frame = PyFrame_New(
23772 if (*frame == NULL)
return 0;
23773 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
23774 Py_INCREF(Py_None);
23775 (*frame)->f_trace = Py_None;
23777 #if PY_VERSION_HEX < 0x030400B1
23779 (*frame)->f_tstate = tstate;
23782 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
23785 __Pyx_SetTracing(tstate, 0);
23786 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
23788 if (tstate->c_tracefunc)
23789 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
23790 if (retval && tstate->c_profilefunc)
23792 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
23793 __Pyx_SetTracing(tstate, (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc)));
23796 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
23797 return __Pyx_IsTracing(tstate, 0, 0) && retval;
23801 Py_XDECREF(traceback);
23805 static PyCodeObject *__Pyx_createFrameCodeObject(
const char *funcname,
const char *srcfile,
int firstlineno) {
23806 PyCodeObject *py_code = 0;
23807 #if PY_MAJOR_VERSION >= 3
23808 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
23809 if (likely(py_code)) {
23810 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
23813 PyObject *py_srcfile = 0;
23814 PyObject *py_funcname = 0;
23815 py_funcname = PyString_FromString(funcname);
23816 if (unlikely(!py_funcname))
goto bad;
23817 py_srcfile = PyString_FromString(srcfile);
23818 if (unlikely(!py_srcfile))
goto bad;
23819 py_code = PyCode_New(
23823 CO_OPTIMIZED | CO_NEWLOCALS,
23836 Py_XDECREF(py_srcfile);
23837 Py_XDECREF(py_funcname);
23844 #if CYTHON_COMPILING_IN_CPYTHON
23845 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23847 ternaryfunc call = Py_TYPE(func)->tp_call;
23848 if (unlikely(!call))
23849 return PyObject_Call(func, arg, kw);
23850 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
23852 result = (*call)(func, arg, kw);
23853 Py_LeaveRecursiveCall();
23854 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23857 "NULL result without error in PyObject_Call");
23864 #if PY_MAJOR_VERSION < 3
23865 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
23866 CYTHON_UNUSED PyObject *cause) {
23867 __Pyx_PyThreadState_declare
23869 if (!value || value == Py_None)
23873 if (!tb || tb == Py_None)
23877 if (!PyTraceBack_Check(tb)) {
23878 PyErr_SetString(PyExc_TypeError,
23879 "raise: arg 3 must be a traceback or None");
23883 if (PyType_Check(type)) {
23884 #if CYTHON_COMPILING_IN_PYPY
23886 Py_INCREF(Py_None);
23890 PyErr_NormalizeException(&type, &value, &tb);
23893 PyErr_SetString(PyExc_TypeError,
23894 "instance exception may not have a separate value");
23898 type = (PyObject*) Py_TYPE(type);
23900 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
23901 PyErr_SetString(PyExc_TypeError,
23902 "raise: exception class must be a subclass of BaseException");
23906 __Pyx_PyThreadState_assign
23907 __Pyx_ErrRestore(type, value, tb);
23916 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
23917 PyObject* owned_instance = NULL;
23918 if (tb == Py_None) {
23920 }
else if (tb && !PyTraceBack_Check(tb)) {
23921 PyErr_SetString(PyExc_TypeError,
23922 "raise: arg 3 must be a traceback or None");
23925 if (value == Py_None)
23927 if (PyExceptionInstance_Check(type)) {
23929 PyErr_SetString(PyExc_TypeError,
23930 "instance exception may not have a separate value");
23934 type = (PyObject*) Py_TYPE(value);
23935 }
else if (PyExceptionClass_Check(type)) {
23936 PyObject *instance_class = NULL;
23937 if (value && PyExceptionInstance_Check(value)) {
23938 instance_class = (PyObject*) Py_TYPE(value);
23939 if (instance_class != type) {
23940 int is_subclass = PyObject_IsSubclass(instance_class, type);
23941 if (!is_subclass) {
23942 instance_class = NULL;
23943 }
else if (unlikely(is_subclass == -1)) {
23946 type = instance_class;
23950 if (!instance_class) {
23953 args = PyTuple_New(0);
23954 else if (PyTuple_Check(value)) {
23958 args = PyTuple_Pack(1, value);
23961 owned_instance = PyObject_Call(type, args, NULL);
23963 if (!owned_instance)
23965 value = owned_instance;
23966 if (!PyExceptionInstance_Check(value)) {
23967 PyErr_Format(PyExc_TypeError,
23968 "calling %R should have returned an instance of "
23969 "BaseException, not %R",
23970 type, Py_TYPE(value));
23975 PyErr_SetString(PyExc_TypeError,
23976 "raise: exception class must be a subclass of BaseException");
23980 PyObject *fixed_cause;
23981 if (cause == Py_None) {
23982 fixed_cause = NULL;
23983 }
else if (PyExceptionClass_Check(cause)) {
23984 fixed_cause = PyObject_CallObject(cause, NULL);
23985 if (fixed_cause == NULL)
23987 }
else if (PyExceptionInstance_Check(cause)) {
23988 fixed_cause = cause;
23989 Py_INCREF(fixed_cause);
23991 PyErr_SetString(PyExc_TypeError,
23992 "exception causes must derive from "
23996 PyException_SetCause(value, fixed_cause);
23998 PyErr_SetObject(type, value);
24000 #if CYTHON_COMPILING_IN_PYPY
24001 PyObject *tmp_type, *tmp_value, *tmp_tb;
24002 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24004 PyErr_Restore(tmp_type, tmp_value, tb);
24005 Py_XDECREF(tmp_tb);
24007 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24008 PyObject* tmp_tb = tstate->curexc_traceback;
24009 if (tb != tmp_tb) {
24011 tstate->curexc_traceback = tb;
24012 Py_XDECREF(tmp_tb);
24017 Py_XDECREF(owned_instance);
24023 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval, CYTHON_UNUSED
long inplace) {
24027 #if PY_MAJOR_VERSION < 3
24028 if (likely(PyInt_CheckExact(op1))) {
24029 const long b = intval;
24030 long a = PyInt_AS_LONG(op1);
24031 if (a != b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24034 #if CYTHON_USE_PYLONG_INTERNALS
24035 if (likely(PyLong_CheckExact(op1))) {
24037 unsigned long uintval;
24038 Py_ssize_t size = Py_SIZE(op1);
24039 const digit* digits = ((PyLongObject*)op1)->ob_digit;
24041 if (size != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24042 }
else if (intval < 0) {
24051 uintval = (
unsigned long) intval;
24052 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
24053 if (uintval >> (PyLong_SHIFT * 4)) {
24054 unequal = (size != 5) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24055 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24058 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
24059 if (uintval >> (PyLong_SHIFT * 3)) {
24060 unequal = (size != 4) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24061 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24064 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
24065 if (uintval >> (PyLong_SHIFT * 2)) {
24066 unequal = (size != 3) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24067 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24070 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
24071 if (uintval >> (PyLong_SHIFT * 1)) {
24072 unequal = (size != 2) || (digits[0] != (uintval & (
unsigned long) PyLong_MASK))
24073 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (
unsigned long) PyLong_MASK));
24076 unequal = (size != 1) || (((
unsigned long) digits[0]) != (uintval & (
unsigned long) PyLong_MASK));
24077 if (unequal != 0) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24080 if (PyFloat_CheckExact(op1)) {
24081 const long b = intval;
24082 double a = PyFloat_AS_DOUBLE(op1);
24083 if ((
double)a != (
double)b) Py_RETURN_TRUE;
else Py_RETURN_FALSE;
24086 PyObject_RichCompare(op1, op2, Py_NE));
24090 static CYTHON_INLINE
int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2,
int equals) {
24091 #if CYTHON_COMPILING_IN_PYPY
24092 return PyObject_RichCompareBool(s1, s2, equals);
24095 return (equals == Py_EQ);
24096 }
else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24097 const char *ps1, *ps2;
24098 Py_ssize_t length = PyBytes_GET_SIZE(s1);
24099 if (length != PyBytes_GET_SIZE(s2))
24100 return (equals == Py_NE);
24101 ps1 = PyBytes_AS_STRING(s1);
24102 ps2 = PyBytes_AS_STRING(s2);
24103 if (ps1[0] != ps2[0]) {
24104 return (equals == Py_NE);
24105 }
else if (length == 1) {
24106 return (equals == Py_EQ);
24109 #if CYTHON_USE_UNICODE_INTERNALS
24110 Py_hash_t hash1, hash2;
24111 hash1 = ((PyBytesObject*)s1)->ob_shash;
24112 hash2 = ((PyBytesObject*)s2)->ob_shash;
24113 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24114 return (equals == Py_NE);
24117 result = memcmp(ps1, ps2, (
size_t)length);
24118 return (equals == Py_EQ) ? (result == 0) : (result != 0);
24120 }
else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24121 return (equals == Py_NE);
24122 }
else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24123 return (equals == Py_NE);
24126 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24129 result = __Pyx_PyObject_IsTrue(py_result);
24130 Py_DECREF(py_result);
24137 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24138 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24139 PyObject *dict = Py_TYPE(obj)->tp_dict;
24140 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24142 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24143 PyObject **dictptr = NULL;
24144 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24146 #if CYTHON_COMPILING_IN_CPYTHON
24147 dictptr = (likely(offset > 0)) ? (PyObject **) ((
char *)obj + offset) : _PyObject_GetDictPtr(obj);
24149 dictptr = _PyObject_GetDictPtr(obj);
24152 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24154 static CYTHON_INLINE
int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24155 PyObject *dict = Py_TYPE(obj)->tp_dict;
24156 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24158 return obj_dict_version == __Pyx_get_object_dict_version(obj);
24163 #if CYTHON_USE_DICT_VERSIONS
24164 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24166 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24170 #if !CYTHON_AVOID_BORROWED_REFS
24171 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24172 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24173 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24174 if (likely(result)) {
24175 return __Pyx_NewRef(result);
24176 }
else if (unlikely(PyErr_Occurred())) {
24180 result = PyDict_GetItem(__pyx_d, name);
24181 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24182 if (likely(result)) {
24183 return __Pyx_NewRef(result);
24187 result = PyObject_GetItem(__pyx_d, name);
24188 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24189 if (likely(result)) {
24190 return __Pyx_NewRef(result);
24194 return __Pyx_GetBuiltinName(name);
24198 #if CYTHON_FAST_PYCCALL
24199 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24200 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24201 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24202 PyObject *
self = PyCFunction_GET_SELF(func);
24203 int flags = PyCFunction_GET_FLAGS(func);
24204 assert(PyCFunction_Check(func));
24205 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24206 assert(nargs >= 0);
24207 assert(nargs == 0 || args != NULL);
24211 assert(!PyErr_Occurred());
24212 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24213 return (*((__Pyx_PyCFunctionFastWithKeywords)(
void*)meth)) (
self, args, nargs, NULL);
24215 return (*((__Pyx_PyCFunctionFast)(
void*)meth)) (
self, args, nargs);
24221 #if CYTHON_FAST_PYCALL
24222 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24223 PyObject *globals) {
24225 PyThreadState *tstate = __Pyx_PyThreadState_Current;
24226 PyObject **fastlocals;
24229 assert(globals != NULL);
24234 assert(tstate != NULL);
24235 f = PyFrame_New(tstate, co, globals, NULL);
24239 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24240 for (i = 0; i < na; i++) {
24242 fastlocals[i] = *args++;
24244 result = PyEval_EvalFrameEx(f,0);
24245 ++tstate->recursion_depth;
24247 --tstate->recursion_depth;
24250 #if 1 || PY_VERSION_HEX < 0x030600B1
24251 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24252 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24253 PyObject *globals = PyFunction_GET_GLOBALS(func);
24254 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24256 #if PY_MAJOR_VERSION >= 3
24259 PyObject *kwtuple, **k;
24264 assert(kwargs == NULL || PyDict_Check(kwargs));
24265 nk = kwargs ? PyDict_Size(kwargs) : 0;
24266 if (Py_EnterRecursiveCall((
char*)
" while calling a Python object")) {
24270 #
if PY_MAJOR_VERSION >= 3
24271 co->co_kwonlyargcount == 0 &&
24273 likely(kwargs == NULL || nk == 0) &&
24274 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24275 if (argdefs == NULL && co->co_argcount == nargs) {
24276 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24279 else if (nargs == 0 && argdefs != NULL
24280 && co->co_argcount == Py_SIZE(argdefs)) {
24283 args = &PyTuple_GET_ITEM(argdefs, 0);
24284 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24288 if (kwargs != NULL) {
24290 kwtuple = PyTuple_New(2 * nk);
24291 if (kwtuple == NULL) {
24295 k = &PyTuple_GET_ITEM(kwtuple, 0);
24297 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24308 closure = PyFunction_GET_CLOSURE(func);
24309 #if PY_MAJOR_VERSION >= 3
24310 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24312 if (argdefs != NULL) {
24313 d = &PyTuple_GET_ITEM(argdefs, 0);
24314 nd = Py_SIZE(argdefs);
24320 #if PY_MAJOR_VERSION >= 3
24321 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24324 d, (
int)nd, kwdefs, closure);
24326 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24329 d, (
int)nd, closure);
24331 Py_XDECREF(kwtuple);
24333 Py_LeaveRecursiveCall();
24340 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject*
function, PyObject* arg1, PyObject* arg2) {
24341 PyObject *args, *result = NULL;
24342 #if CYTHON_FAST_PYCALL
24343 if (PyFunction_Check(
function)) {
24344 PyObject *args[2] = {arg1, arg2};
24345 return __Pyx_PyFunction_FastCall(
function, args, 2);
24348 #if CYTHON_FAST_PYCCALL
24349 if (__Pyx_PyFastCFunction_Check(
function)) {
24350 PyObject *args[2] = {arg1, arg2};
24351 return __Pyx_PyCFunction_FastCall(
function, args, 2);
24354 args = PyTuple_New(2);
24355 if (unlikely(!args))
goto done;
24357 PyTuple_SET_ITEM(args, 0, arg1);
24359 PyTuple_SET_ITEM(args, 1, arg2);
24360 Py_INCREF(
function);
24361 result = __Pyx_PyObject_Call(
function, args, NULL);
24363 Py_DECREF(
function);
24369 #if CYTHON_COMPILING_IN_CPYTHON
24370 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24371 PyObject *
self, *result;
24373 cfunc = PyCFunction_GET_FUNCTION(func);
24374 self = PyCFunction_GET_SELF(func);
24375 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24377 result = cfunc(
self, arg);
24378 Py_LeaveRecursiveCall();
24379 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24382 "NULL result without error in PyObject_Call");
24389 #if CYTHON_COMPILING_IN_CPYTHON
24390 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24392 PyObject *args = PyTuple_New(1);
24393 if (unlikely(!args))
return NULL;
24395 PyTuple_SET_ITEM(args, 0, arg);
24396 result = __Pyx_PyObject_Call(func, args, NULL);
24400 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24401 #if CYTHON_FAST_PYCALL
24402 if (PyFunction_Check(func)) {
24403 return __Pyx_PyFunction_FastCall(func, &arg, 1);
24406 if (likely(PyCFunction_Check(func))) {
24407 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24408 return __Pyx_PyObject_CallMethO(func, arg);
24409 #if CYTHON_FAST_PYCCALL
24410 }
else if (__Pyx_PyFastCFunction_Check(func)) {
24411 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24415 return __Pyx__PyObject_CallOneArg(func, arg);
24418 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24420 PyObject *args = PyTuple_Pack(1, arg);
24421 if (unlikely(!args))
return NULL;
24422 result = __Pyx_PyObject_Call(func, args, NULL);
24429 #if CYTHON_COMPILING_IN_CPYTHON
24430 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24431 #if CYTHON_FAST_PYCALL
24432 if (PyFunction_Check(func)) {
24433 return __Pyx_PyFunction_FastCall(func, NULL, 0);
24436 #ifdef __Pyx_CyFunction_USED
24437 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24439 if (likely(PyCFunction_Check(func)))
24442 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24443 return __Pyx_PyObject_CallMethO(func, NULL);
24446 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24451 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24453 if (!j)
return NULL;
24454 r = PyObject_GetItem(o, j);
24458 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24459 CYTHON_NCP_UNUSED
int wraparound,
24460 CYTHON_NCP_UNUSED
int boundscheck) {
24461 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24462 Py_ssize_t wrapped_i = i;
24463 if (wraparound & unlikely(i < 0)) {
24464 wrapped_i += PyList_GET_SIZE(o);
24466 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24467 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24471 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24473 return PySequence_GetItem(o, i);
24476 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24477 CYTHON_NCP_UNUSED
int wraparound,
24478 CYTHON_NCP_UNUSED
int boundscheck) {
24479 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24480 Py_ssize_t wrapped_i = i;
24481 if (wraparound & unlikely(i < 0)) {
24482 wrapped_i += PyTuple_GET_SIZE(o);
24484 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24485 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24489 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24491 return PySequence_GetItem(o, i);
24494 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24495 CYTHON_NCP_UNUSED
int wraparound,
24496 CYTHON_NCP_UNUSED
int boundscheck) {
24497 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24498 if (is_list || PyList_CheckExact(o)) {
24499 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24500 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24501 PyObject *r = PyList_GET_ITEM(o, n);
24506 else if (PyTuple_CheckExact(o)) {
24507 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24508 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24509 PyObject *r = PyTuple_GET_ITEM(o, n);
24514 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24515 if (likely(m && m->sq_item)) {
24516 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24517 Py_ssize_t l = m->sq_length(o);
24518 if (likely(l >= 0)) {
24521 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24526 return m->sq_item(o, i);
24530 if (is_list || PySequence_Check(o)) {
24531 return PySequence_GetItem(o, i);
24534 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24538 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24539 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24541 value = PyDict_GetItemWithError(d, key);
24542 if (unlikely(!value)) {
24543 if (!PyErr_Occurred()) {
24544 if (unlikely(PyTuple_Check(key))) {
24545 PyObject* args = PyTuple_Pack(1, key);
24546 if (likely(args)) {
24547 PyErr_SetObject(PyExc_KeyError, args);
24551 PyErr_SetObject(PyExc_KeyError, key);
24563 __Pyx_init_memviewslice(
struct __pyx_memoryview_obj *memview,
24565 __Pyx_memviewslice *memviewslice,
24566 int memview_is_new_reference)
24568 __Pyx_RefNannyDeclarations
24570 Py_buffer *buf = &memview->view;
24571 __Pyx_RefNannySetupContext(
"init_memviewslice", 0);
24572 if (unlikely(memviewslice->memview || memviewslice->data)) {
24573 PyErr_SetString(PyExc_ValueError,
24574 "memviewslice is already initialized!");
24577 if (buf->strides) {
24578 for (i = 0; i < ndim; i++) {
24579 memviewslice->strides[i] = buf->strides[i];
24582 Py_ssize_t stride = buf->itemsize;
24583 for (i = ndim - 1; i >= 0; i--) {
24584 memviewslice->strides[i] = stride;
24585 stride *= buf->shape[i];
24588 for (i = 0; i < ndim; i++) {
24589 memviewslice->shape[i] = buf->shape[i];
24590 if (buf->suboffsets) {
24591 memviewslice->suboffsets[i] = buf->suboffsets[i];
24593 memviewslice->suboffsets[i] = -1;
24596 memviewslice->memview = memview;
24597 memviewslice->data = (
char *)buf->buf;
24598 if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24599 Py_INCREF(memview);
24604 memviewslice->memview = 0;
24605 memviewslice->data = 0;
24608 __Pyx_RefNannyFinishContext();
24611 #ifndef Py_NO_RETURN
24612 #define Py_NO_RETURN
24614 static void __pyx_fatalerror(
const char *fmt, ...) Py_NO_RETURN {
24617 #ifdef HAVE_STDARG_PROTOTYPES
24618 va_start(vargs, fmt);
24622 vsnprintf(msg, 200, fmt, vargs);
24624 Py_FatalError(msg);
24626 static CYTHON_INLINE
int
24627 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24628 PyThread_type_lock lock)
24631 PyThread_acquire_lock(lock, 1);
24632 result = (*acquisition_count)++;
24633 PyThread_release_lock(lock);
24636 static CYTHON_INLINE
int
24637 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24638 PyThread_type_lock lock)
24641 PyThread_acquire_lock(lock, 1);
24642 result = (*acquisition_count)--;
24643 PyThread_release_lock(lock);
24646 static CYTHON_INLINE
void
24647 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice,
int have_gil,
int lineno)
24650 struct __pyx_memoryview_obj *memview = memslice->memview;
24651 if (unlikely(!memview || (PyObject *) memview == Py_None))
24653 if (unlikely(__pyx_get_slice_count(memview) < 0))
24654 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24655 __pyx_get_slice_count(memview), lineno);
24656 first_time = __pyx_add_acquisition_count(memview) == 0;
24657 if (unlikely(first_time)) {
24659 Py_INCREF((PyObject *) memview);
24661 PyGILState_STATE _gilstate = PyGILState_Ensure();
24662 Py_INCREF((PyObject *) memview);
24663 PyGILState_Release(_gilstate);
24667 static CYTHON_INLINE
void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24668 int have_gil,
int lineno) {
24670 struct __pyx_memoryview_obj *memview = memslice->memview;
24671 if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24672 memslice->memview = NULL;
24675 if (unlikely(__pyx_get_slice_count(memview) <= 0))
24676 __pyx_fatalerror(
"Acquisition count is %d (line %d)",
24677 __pyx_get_slice_count(memview), lineno);
24678 last_time = __pyx_sub_acquisition_count(memview) == 1;
24679 memslice->data = NULL;
24680 if (unlikely(last_time)) {
24682 Py_CLEAR(memslice->memview);
24684 PyGILState_STATE _gilstate = PyGILState_Ensure();
24685 Py_CLEAR(memslice->memview);
24686 PyGILState_Release(_gilstate);
24689 memslice->memview = NULL;
24694 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type,
const char *name,
int exact)
24696 if (unlikely(!type)) {
24697 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24701 #if PY_MAJOR_VERSION == 2
24702 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
24706 if (likely(__Pyx_TypeCheck(obj, type)))
return 1;
24708 PyErr_Format(PyExc_TypeError,
24709 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24710 name, type->tp_name, Py_TYPE(obj)->tp_name);
24715 static CYTHON_INLINE
int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2,
int equals) {
24716 #if CYTHON_COMPILING_IN_PYPY
24717 return PyObject_RichCompareBool(s1, s2, equals);
24719 #if PY_MAJOR_VERSION < 3
24720 PyObject* owned_ref = NULL;
24722 int s1_is_unicode, s2_is_unicode;
24726 s1_is_unicode = PyUnicode_CheckExact(s1);
24727 s2_is_unicode = PyUnicode_CheckExact(s2);
24728 #if PY_MAJOR_VERSION < 3
24729 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24730 owned_ref = PyUnicode_FromObject(s2);
24731 if (unlikely(!owned_ref))
24735 }
else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24736 owned_ref = PyUnicode_FromObject(s1);
24737 if (unlikely(!owned_ref))
24741 }
else if (((!s2_is_unicode) & (!s1_is_unicode))) {
24742 return __Pyx_PyBytes_Equals(s1, s2, equals);
24745 if (s1_is_unicode & s2_is_unicode) {
24748 void *data1, *data2;
24749 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
24751 length = __Pyx_PyUnicode_GET_LENGTH(s1);
24752 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
24755 #if CYTHON_USE_UNICODE_INTERNALS
24757 Py_hash_t hash1, hash2;
24758 #if CYTHON_PEP393_ENABLED
24759 hash1 = ((PyASCIIObject*)s1)->hash;
24760 hash2 = ((PyASCIIObject*)s2)->hash;
24762 hash1 = ((PyUnicodeObject*)s1)->hash;
24763 hash2 = ((PyUnicodeObject*)s2)->hash;
24765 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24770 kind = __Pyx_PyUnicode_KIND(s1);
24771 if (kind != __Pyx_PyUnicode_KIND(s2)) {
24774 data1 = __Pyx_PyUnicode_DATA(s1);
24775 data2 = __Pyx_PyUnicode_DATA(s2);
24776 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
24778 }
else if (length == 1) {
24781 int result = memcmp(data1, data2, (
size_t)(length * kind));
24782 #if PY_MAJOR_VERSION < 3
24783 Py_XDECREF(owned_ref);
24785 return (equals == Py_EQ) ? (result == 0) : (result != 0);
24787 }
else if ((s1 == Py_None) & s2_is_unicode) {
24789 }
else if ((s2 == Py_None) & s1_is_unicode) {
24793 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24794 #if PY_MAJOR_VERSION < 3
24795 Py_XDECREF(owned_ref);
24799 result = __Pyx_PyObject_IsTrue(py_result);
24800 Py_DECREF(py_result);
24804 #if PY_MAJOR_VERSION < 3
24805 Py_XDECREF(owned_ref);
24807 return (equals == Py_EQ);
24809 #if PY_MAJOR_VERSION < 3
24810 Py_XDECREF(owned_ref);
24812 return (equals == Py_NE);
24817 static void __Pyx_WriteUnraisable(
const char *name, CYTHON_UNUSED
int clineno,
24818 CYTHON_UNUSED
int lineno, CYTHON_UNUSED
const char *filename,
24819 int full_traceback, CYTHON_UNUSED
int nogil) {
24820 PyObject *old_exc, *old_val, *old_tb;
24822 __Pyx_PyThreadState_declare
24824 PyGILState_STATE state;
24826 state = PyGILState_Ensure();
24828 else state = (PyGILState_STATE)-1;
24831 __Pyx_PyThreadState_assign
24832 __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24833 if (full_traceback) {
24834 Py_XINCREF(old_exc);
24835 Py_XINCREF(old_val);
24836 Py_XINCREF(old_tb);
24837 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24840 #if PY_MAJOR_VERSION < 3
24841 ctx = PyString_FromString(name);
24843 ctx = PyUnicode_FromString(name);
24845 __Pyx_ErrRestore(old_exc, old_val, old_tb);
24847 PyErr_WriteUnraisable(Py_None);
24849 PyErr_WriteUnraisable(ctx);
24854 PyGILState_Release(state);
24859 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24860 #if CYTHON_USE_TYPE_SLOTS
24861 #if PY_MAJOR_VERSION >= 3
24862 if (likely(PyUnicode_Check(n)))
24864 if (likely(PyString_Check(n)))
24866 return __Pyx_PyObject_GetAttrStr(o, n);
24868 return PyObject_GetAttr(o, n);
24872 #if CYTHON_USE_TYPE_SLOTS
24873 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24875 Py_ssize_t key_value;
24876 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24877 if (unlikely(!(m && m->sq_item))) {
24878 PyErr_Format(PyExc_TypeError,
"'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24881 key_value = __Pyx_PyIndex_AsSsize_t(index);
24882 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24883 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24885 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24887 PyErr_Format(PyExc_IndexError,
"cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24891 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24892 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24893 if (likely(m && m->mp_subscript)) {
24894 return m->mp_subscript(obj, key);
24896 return __Pyx_PyObject_GetIndex(obj, key);
24901 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
24902 const char* cstring, Py_ssize_t start, Py_ssize_t stop,
24903 const char* encoding,
const char* errors,
24904 PyObject* (*decode_func)(
const char *s, Py_ssize_t size,
const char *errors)) {
24906 if (unlikely((start < 0) | (stop < 0))) {
24907 size_t slen = strlen(cstring);
24908 if (unlikely(slen > (
size_t) PY_SSIZE_T_MAX)) {
24909 PyErr_SetString(PyExc_OverflowError,
24910 "c-string too long to convert to Python");
24913 length = (Py_ssize_t) slen;
24922 if (unlikely(stop <= start))
24923 return __Pyx_NewRef(__pyx_empty_unicode);
24924 length = stop - start;
24927 return decode_func(cstring, length, errors);
24929 return PyUnicode_Decode(cstring, length, encoding, errors);
24934 #if CYTHON_FAST_THREAD_STATE
24935 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24937 n = PyTuple_GET_SIZE(tuple);
24938 #if PY_MAJOR_VERSION >= 3
24939 for (i=0; i<n; i++) {
24940 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
24943 for (i=0; i<n; i++) {
24944 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i)))
return 1;
24948 static CYTHON_INLINE
int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24949 PyObject *exc_type = tstate->curexc_type;
24950 if (exc_type == err)
return 1;
24951 if (unlikely(!exc_type))
return 0;
24952 if (unlikely(PyTuple_Check(err)))
24953 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24954 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24959 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24960 __Pyx_PyThreadState_declare
24961 __Pyx_PyThreadState_assign
24962 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24964 __Pyx_PyErr_Clear();
24968 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24969 PyObject *r = __Pyx_GetAttr(o, n);
24970 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24974 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24975 PyErr_Format(PyExc_ValueError,
24976 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
24980 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24981 PyErr_Format(PyExc_ValueError,
24982 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
24983 index, (index == 1) ?
"" :
"s");
24987 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
24988 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
24992 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24993 if (unlikely(!type)) {
24994 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24997 if (likely(__Pyx_TypeCheck(obj, type)))
24999 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
25000 Py_TYPE(obj)->tp_name, type->tp_name);
25005 #if CYTHON_USE_EXC_INFO_STACK
25006 static _PyErr_StackItem *
25007 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25009 _PyErr_StackItem *exc_info = tstate->exc_info;
25010 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25011 exc_info->previous_item != NULL)
25013 exc_info = exc_info->previous_item;
25020 #if CYTHON_FAST_THREAD_STATE
25021 static CYTHON_INLINE
void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25022 #if CYTHON_USE_EXC_INFO_STACK
25023 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
25024 *type = exc_info->exc_type;
25025 *value = exc_info->exc_value;
25026 *tb = exc_info->exc_traceback;
25028 *type = tstate->exc_type;
25029 *value = tstate->exc_value;
25030 *tb = tstate->exc_traceback;
25033 Py_XINCREF(*value);
25036 static CYTHON_INLINE
void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25037 PyObject *tmp_type, *tmp_value, *tmp_tb;
25038 #if CYTHON_USE_EXC_INFO_STACK
25039 _PyErr_StackItem *exc_info = tstate->exc_info;
25040 tmp_type = exc_info->exc_type;
25041 tmp_value = exc_info->exc_value;
25042 tmp_tb = exc_info->exc_traceback;
25043 exc_info->exc_type = type;
25044 exc_info->exc_value = value;
25045 exc_info->exc_traceback = tb;
25047 tmp_type = tstate->exc_type;
25048 tmp_value = tstate->exc_value;
25049 tmp_tb = tstate->exc_traceback;
25050 tstate->exc_type = type;
25051 tstate->exc_value = value;
25052 tstate->exc_traceback = tb;
25054 Py_XDECREF(tmp_type);
25055 Py_XDECREF(tmp_value);
25056 Py_XDECREF(tmp_tb);
25061 #if CYTHON_FAST_THREAD_STATE
25062 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25064 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25067 PyObject *local_type, *local_value, *local_tb;
25068 #if CYTHON_FAST_THREAD_STATE
25069 PyObject *tmp_type, *tmp_value, *tmp_tb;
25070 local_type = tstate->curexc_type;
25071 local_value = tstate->curexc_value;
25072 local_tb = tstate->curexc_traceback;
25073 tstate->curexc_type = 0;
25074 tstate->curexc_value = 0;
25075 tstate->curexc_traceback = 0;
25077 PyErr_Fetch(&local_type, &local_value, &local_tb);
25079 PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25080 #if CYTHON_FAST_THREAD_STATE
25081 if (unlikely(tstate->curexc_type))
25083 if (unlikely(PyErr_Occurred()))
25086 #if PY_MAJOR_VERSION >= 3
25088 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25092 Py_XINCREF(local_tb);
25093 Py_XINCREF(local_type);
25094 Py_XINCREF(local_value);
25095 *type = local_type;
25096 *value = local_value;
25098 #if CYTHON_FAST_THREAD_STATE
25099 #if CYTHON_USE_EXC_INFO_STACK
25101 _PyErr_StackItem *exc_info = tstate->exc_info;
25102 tmp_type = exc_info->exc_type;
25103 tmp_value = exc_info->exc_value;
25104 tmp_tb = exc_info->exc_traceback;
25105 exc_info->exc_type = local_type;
25106 exc_info->exc_value = local_value;
25107 exc_info->exc_traceback = local_tb;
25110 tmp_type = tstate->exc_type;
25111 tmp_value = tstate->exc_value;
25112 tmp_tb = tstate->exc_traceback;
25113 tstate->exc_type = local_type;
25114 tstate->exc_value = local_value;
25115 tstate->exc_traceback = local_tb;
25117 Py_XDECREF(tmp_type);
25118 Py_XDECREF(tmp_value);
25119 Py_XDECREF(tmp_tb);
25121 PyErr_SetExcInfo(local_type, local_value, local_tb);
25128 Py_XDECREF(local_type);
25129 Py_XDECREF(local_value);
25130 Py_XDECREF(local_tb);
25135 #if CYTHON_FAST_THREAD_STATE
25136 static CYTHON_INLINE
void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25137 PyObject *tmp_type, *tmp_value, *tmp_tb;
25138 #if CYTHON_USE_EXC_INFO_STACK
25139 _PyErr_StackItem *exc_info = tstate->exc_info;
25140 tmp_type = exc_info->exc_type;
25141 tmp_value = exc_info->exc_value;
25142 tmp_tb = exc_info->exc_traceback;
25143 exc_info->exc_type = *type;
25144 exc_info->exc_value = *value;
25145 exc_info->exc_traceback = *tb;
25147 tmp_type = tstate->exc_type;
25148 tmp_value = tstate->exc_value;
25149 tmp_tb = tstate->exc_traceback;
25150 tstate->exc_type = *type;
25151 tstate->exc_value = *value;
25152 tstate->exc_traceback = *tb;
25155 *value = tmp_value;
25159 static CYTHON_INLINE
void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25160 PyObject *tmp_type, *tmp_value, *tmp_tb;
25161 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25162 PyErr_SetExcInfo(*type, *value, *tb);
25164 *value = tmp_value;
25170 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
25171 PyObject *empty_list = 0;
25172 PyObject *module = 0;
25173 PyObject *global_dict = 0;
25174 PyObject *empty_dict = 0;
25176 #if PY_MAJOR_VERSION < 3
25177 PyObject *py_import;
25178 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25185 empty_list = PyList_New(0);
25190 global_dict = PyModule_GetDict(__pyx_m);
25193 empty_dict = PyDict_New();
25197 #if PY_MAJOR_VERSION >= 3
25199 if ((1) && (strchr(__Pyx_MODULE_NAME,
'.'))) {
25200 module = PyImport_ImportModuleLevelObject(
25201 name, global_dict, empty_dict, list, 1);
25203 if (!PyErr_ExceptionMatches(PyExc_ImportError))
25212 #if PY_MAJOR_VERSION < 3
25213 PyObject *py_level = PyInt_FromLong(level);
25216 module = PyObject_CallFunctionObjArgs(py_import,
25217 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25218 Py_DECREF(py_level);
25220 module = PyImport_ImportModuleLevelObject(
25221 name, global_dict, empty_dict, list, level);
25226 #if PY_MAJOR_VERSION < 3
25227 Py_XDECREF(py_import);
25229 Py_XDECREF(empty_list);
25230 Py_XDECREF(empty_dict);
25235 #if CYTHON_COMPILING_IN_CPYTHON
25236 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25242 return b == &PyBaseObject_Type;
25244 static CYTHON_INLINE
int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25246 if (a == b)
return 1;
25250 n = PyTuple_GET_SIZE(mro);
25251 for (i = 0; i < n; i++) {
25252 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25257 return __Pyx_InBases(a, b);
25259 #if PY_MAJOR_VERSION == 2
25260 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25261 PyObject *exception, *value, *tb;
25263 __Pyx_PyThreadState_declare
25264 __Pyx_PyThreadState_assign
25265 __Pyx_ErrFetch(&exception, &value, &tb);
25266 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25267 if (unlikely(res == -1)) {
25268 PyErr_WriteUnraisable(err);
25272 res = PyObject_IsSubclass(err, exc_type2);
25273 if (unlikely(res == -1)) {
25274 PyErr_WriteUnraisable(err);
25278 __Pyx_ErrRestore(exception, value, tb);
25282 static CYTHON_INLINE
int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25283 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25285 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25290 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25292 assert(PyExceptionClass_Check(exc_type));
25293 n = PyTuple_GET_SIZE(tuple);
25294 #if PY_MAJOR_VERSION >= 3
25295 for (i=0; i<n; i++) {
25296 if (exc_type == PyTuple_GET_ITEM(tuple, i))
return 1;
25299 for (i=0; i<n; i++) {
25300 PyObject *t = PyTuple_GET_ITEM(tuple, i);
25301 #if PY_MAJOR_VERSION < 3
25302 if (likely(exc_type == t))
return 1;
25304 if (likely(PyExceptionClass_Check(t))) {
25305 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t))
return 1;
25311 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25312 if (likely(err == exc_type))
return 1;
25313 if (likely(PyExceptionClass_Check(err))) {
25314 if (likely(PyExceptionClass_Check(exc_type))) {
25315 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25316 }
else if (likely(PyTuple_Check(exc_type))) {
25317 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25321 return PyErr_GivenExceptionMatches(err, exc_type);
25323 static CYTHON_INLINE
int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25324 assert(PyExceptionClass_Check(exc_type1));
25325 assert(PyExceptionClass_Check(exc_type2));
25326 if (likely(err == exc_type1 || err == exc_type2))
return 1;
25327 if (likely(PyExceptionClass_Check(err))) {
25328 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25330 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25335 #if !CYTHON_COMPILING_IN_PYPY
25336 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED
long intval,
int inplace,
int zerodivision_check) {
25338 (void)zerodivision_check;
25339 #if PY_MAJOR_VERSION < 3
25340 if (likely(PyInt_CheckExact(op1))) {
25341 const long b = intval;
25343 long a = PyInt_AS_LONG(op1);
25344 x = (long)((
unsigned long)a + b);
25345 if (likely((x^a) >= 0 || (x^b) >= 0))
25346 return PyInt_FromLong(x);
25347 return PyLong_Type.tp_as_number->nb_add(op1, op2);
25350 #if CYTHON_USE_PYLONG_INTERNALS
25351 if (likely(PyLong_CheckExact(op1))) {
25352 const long b = intval;
25354 #ifdef HAVE_LONG_LONG
25355 const PY_LONG_LONG llb = intval;
25356 PY_LONG_LONG lla, llx;
25358 const digit* digits = ((PyLongObject*)op1)->ob_digit;
25359 const Py_ssize_t size = Py_SIZE(op1);
25360 if (likely(__Pyx_sst_abs(size) <= 1)) {
25361 a = likely(size) ? digits[0] : 0;
25362 if (size == -1) a = -a;
25366 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25367 a = -(long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25369 #ifdef HAVE_LONG_LONG
25370 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25371 lla = -(PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25375 CYTHON_FALLTHROUGH;
25377 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25378 a = (long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25380 #ifdef HAVE_LONG_LONG
25381 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25382 lla = (PY_LONG_LONG) (((((
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25386 CYTHON_FALLTHROUGH;
25388 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25389 a = -(long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25391 #ifdef HAVE_LONG_LONG
25392 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25393 lla = -(PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25397 CYTHON_FALLTHROUGH;
25399 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25400 a = (long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25402 #ifdef HAVE_LONG_LONG
25403 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25404 lla = (PY_LONG_LONG) (((((((
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25408 CYTHON_FALLTHROUGH;
25410 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25411 a = -(long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25413 #ifdef HAVE_LONG_LONG
25414 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25415 lla = -(PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25419 CYTHON_FALLTHROUGH;
25421 if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25422 a = (long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
25424 #ifdef HAVE_LONG_LONG
25425 }
else if (8 *
sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25426 lla = (PY_LONG_LONG) (((((((((
unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (
unsigned PY_LONG_LONG)digits[0]));
25430 CYTHON_FALLTHROUGH;
25431 default:
return PyLong_Type.tp_as_number->nb_add(op1, op2);
25435 return PyLong_FromLong(x);
25436 #ifdef HAVE_LONG_LONG
25439 return PyLong_FromLongLong(llx);
25445 if (PyFloat_CheckExact(op1)) {
25446 const long b = intval;
25447 double a = PyFloat_AS_DOUBLE(op1);
25449 PyFPE_START_PROTECT(
"add",
return NULL)
25450 result = ((double)a) + (double)b;
25451 PyFPE_END_PROTECT(result)
25452 return PyFloat_FromDouble(result);
25454 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25459 static CYTHON_INLINE
void __Pyx_RaiseUnboundLocalError(
const char *varname) {
25460 PyErr_Format(PyExc_UnboundLocalError,
"local variable '%s' referenced before assignment", varname);
25464 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25465 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25466 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25467 PyErr_Format(PyExc_ImportError,
25468 #
if PY_MAJOR_VERSION < 3
25469 "cannot import name %.230s", PyString_AS_STRING(name));
25471 "cannot import name %S", name);
25478 static CYTHON_INLINE
int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25480 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25481 PyErr_SetString(PyExc_TypeError,
25482 "hasattr(): attribute name must be string");
25485 r = __Pyx_GetAttr(o, n);
25486 if (unlikely(!r)) {
25496 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
25497 PyTypeObject* type = Py_TYPE(obj);
25498 while (type && type->tp_dealloc != current_tp_dealloc)
25499 type = type->tp_base;
25500 while (type && type->tp_dealloc == current_tp_dealloc)
25501 type = type->tp_base;
25503 type->tp_dealloc(obj);
25507 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v,
void *a, traverseproc current_tp_traverse) {
25508 PyTypeObject* type = Py_TYPE(obj);
25509 while (type && type->tp_traverse != current_tp_traverse)
25510 type = type->tp_base;
25511 while (type && type->tp_traverse == current_tp_traverse)
25512 type = type->tp_base;
25513 if (type && type->tp_traverse)
25514 return type->tp_traverse(obj, v, a);
25519 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
25520 PyTypeObject* type = Py_TYPE(obj);
25521 while (type && type->tp_clear != current_tp_clear)
25522 type = type->tp_base;
25523 while (type && type->tp_clear == current_tp_clear)
25524 type = type->tp_base;
25525 if (type && type->tp_clear)
25526 type->tp_clear(obj);
25530 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25531 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25532 PyErr_Format(PyExc_AttributeError,
25533 #
if PY_MAJOR_VERSION >= 3
25534 "'%.50s' object has no attribute '%U'",
25535 tp->tp_name, attr_name);
25537 "'%.50s' object has no attribute '%.400s'",
25538 tp->tp_name, PyString_AS_STRING(attr_name));
25542 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25544 PyTypeObject *tp = Py_TYPE(obj);
25545 if (unlikely(!PyString_Check(attr_name))) {
25546 return PyObject_GenericGetAttr(obj, attr_name);
25548 assert(!tp->tp_dictoffset);
25549 descr = _PyType_Lookup(tp, attr_name);
25550 if (unlikely(!descr)) {
25551 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25554 #if PY_MAJOR_VERSION < 3
25555 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25558 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25560 PyObject *res = f(descr, obj, (PyObject *)tp);
25570 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25571 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25572 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25573 return PyObject_GenericGetAttr(obj, attr_name);
25575 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25580 #ifndef __PYX_HAVE_RT_ImportType
25581 #define __PYX_HAVE_RT_ImportType
25582 static PyTypeObject *__Pyx_ImportType(PyObject *module,
const char *module_name,
const char *class_name,
25583 size_t size,
enum __Pyx_ImportType_CheckSize check_size)
25585 PyObject *result = 0;
25587 Py_ssize_t basicsize;
25588 #ifdef Py_LIMITED_API
25589 PyObject *py_basicsize;
25591 result = PyObject_GetAttrString(module, class_name);
25594 if (!PyType_Check(result)) {
25595 PyErr_Format(PyExc_TypeError,
25596 "%.200s.%.200s is not a type object",
25597 module_name, class_name);
25600 #ifndef Py_LIMITED_API
25601 basicsize = ((PyTypeObject *)result)->tp_basicsize;
25603 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
25606 basicsize = PyLong_AsSsize_t(py_basicsize);
25607 Py_DECREF(py_basicsize);
25609 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25612 if ((
size_t)basicsize < size) {
25613 PyErr_Format(PyExc_ValueError,
25614 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25615 "Expected %zd from C header, got %zd from PyObject",
25616 module_name, class_name, size, basicsize);
25619 if (check_size == __Pyx_ImportType_CheckSize_Error && (
size_t)basicsize != size) {
25620 PyErr_Format(PyExc_ValueError,
25621 "%.200s.%.200s size changed, may indicate binary incompatibility. "
25622 "Expected %zd from C header, got %zd from PyObject",
25623 module_name, class_name, size, basicsize);
25626 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (
size_t)basicsize > size) {
25627 PyOS_snprintf(warning,
sizeof(warning),
25628 "%s.%s size changed, may indicate binary incompatibility. "
25629 "Expected %zd from C header, got %zd from PyObject",
25630 module_name, class_name, size, basicsize);
25631 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
25633 return (PyTypeObject *)result;
25635 Py_XDECREF(result);
25641 static void* __Pyx_GetVtable(PyObject *dict) {
25643 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
25646 #if PY_VERSION_HEX >= 0x02070000
25647 ptr = PyCapsule_GetPointer(ob, 0);
25649 ptr = PyCObject_AsVoidPtr(ob);
25651 if (!ptr && !PyErr_Occurred())
25652 PyErr_SetString(PyExc_RuntimeError,
"invalid vtable found for imported type");
25661 static int __Pyx_SetVtable(PyObject *dict,
void *vtable) {
25662 #if PY_VERSION_HEX >= 0x02070000
25663 PyObject *ob = PyCapsule_New(vtable, 0, 0);
25665 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25669 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25679 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(
void) {
25680 __Pyx_PyThreadState_declare
25681 __Pyx_PyThreadState_assign
25682 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25683 __Pyx_PyErr_Clear();
25685 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25687 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25688 PyTypeObject* tp = Py_TYPE(obj);
25689 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25690 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25693 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25694 if (unlikely(!result)) {
25695 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25701 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25703 PyObject *name_attr;
25704 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25705 if (likely(name_attr)) {
25706 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25710 if (unlikely(ret < 0)) {
25714 Py_XDECREF(name_attr);
25717 static int __Pyx_setup_reduce(PyObject* type_obj) {
25719 PyObject *object_reduce = NULL;
25720 PyObject *object_reduce_ex = NULL;
25721 PyObject *reduce = NULL;
25722 PyObject *reduce_ex = NULL;
25723 PyObject *reduce_cython = NULL;
25724 PyObject *setstate = NULL;
25725 PyObject *setstate_cython = NULL;
25726 #if CYTHON_USE_PYTYPE_LOOKUP
25727 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
25729 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate))
goto __PYX_GOOD;
25731 #if CYTHON_USE_PYTYPE_LOOKUP
25732 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25734 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex);
if (!object_reduce_ex)
goto __PYX_BAD;
25736 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex);
if (unlikely(!reduce_ex))
goto __PYX_BAD;
25737 if (reduce_ex == object_reduce_ex) {
25738 #if CYTHON_USE_PYTYPE_LOOKUP
25739 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25741 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce);
if (!object_reduce)
goto __PYX_BAD;
25743 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce);
if (unlikely(!reduce))
goto __PYX_BAD;
25744 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25745 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25746 if (likely(reduce_cython)) {
25747 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25748 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25749 }
else if (reduce == object_reduce || PyErr_Occurred()) {
25752 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25753 if (!setstate) PyErr_Clear();
25754 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25755 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25756 if (likely(setstate_cython)) {
25757 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25758 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython);
if (unlikely(ret < 0))
goto __PYX_BAD;
25759 }
else if (!setstate || PyErr_Occurred()) {
25763 PyType_Modified((PyTypeObject*)type_obj);
25768 if (!PyErr_Occurred())
25769 PyErr_Format(PyExc_RuntimeError,
"Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25772 #if !CYTHON_USE_PYTYPE_LOOKUP
25773 Py_XDECREF(object_reduce);
25774 Py_XDECREF(object_reduce_ex);
25776 Py_XDECREF(reduce);
25777 Py_XDECREF(reduce_ex);
25778 Py_XDECREF(reduce_cython);
25779 Py_XDECREF(setstate);
25780 Py_XDECREF(setstate_cython);
25785 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25786 PyObject* fake_module;
25787 PyTypeObject* cached_type = NULL;
25788 fake_module = PyImport_AddModule((
char*)
"_cython_" CYTHON_ABI);
25789 if (!fake_module)
return NULL;
25790 Py_INCREF(fake_module);
25791 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25793 if (!PyType_Check((PyObject*)cached_type)) {
25794 PyErr_Format(PyExc_TypeError,
25795 "Shared Cython type %.200s is not a type object",
25799 if (cached_type->tp_basicsize != type->tp_basicsize) {
25800 PyErr_Format(PyExc_TypeError,
25801 "Shared Cython type %.200s has the wrong size, try recompiling",
25806 if (!PyErr_ExceptionMatches(PyExc_AttributeError))
goto bad;
25808 if (PyType_Ready(type) < 0)
goto bad;
25809 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25812 cached_type = type;
25815 Py_DECREF(fake_module);
25816 return cached_type;
25818 Py_XDECREF(cached_type);
25819 cached_type = NULL;
25824 #include <structmember.h>
25826 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *closure)
25828 if (unlikely(op->func_doc == NULL)) {
25829 if (op->func.m_ml->ml_doc) {
25830 #if PY_MAJOR_VERSION >= 3
25831 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25833 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25835 if (unlikely(op->func_doc == NULL))
25838 Py_INCREF(Py_None);
25842 Py_INCREF(op->func_doc);
25843 return op->func_doc;
25846 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25848 PyObject *tmp = op->func_doc;
25849 if (value == NULL) {
25853 op->func_doc = value;
25858 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25860 if (unlikely(op->func_name == NULL)) {
25861 #if PY_MAJOR_VERSION >= 3
25862 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25864 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25866 if (unlikely(op->func_name == NULL))
25869 Py_INCREF(op->func_name);
25870 return op->func_name;
25873 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25876 #if PY_MAJOR_VERSION >= 3
25877 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25879 if (unlikely(value == NULL || !PyString_Check(value)))
25882 PyErr_SetString(PyExc_TypeError,
25883 "__name__ must be set to a string object");
25886 tmp = op->func_name;
25888 op->func_name = value;
25893 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25895 Py_INCREF(op->func_qualname);
25896 return op->func_qualname;
25899 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25902 #if PY_MAJOR_VERSION >= 3
25903 if (unlikely(value == NULL || !PyUnicode_Check(value)))
25905 if (unlikely(value == NULL || !PyString_Check(value)))
25908 PyErr_SetString(PyExc_TypeError,
25909 "__qualname__ must be set to a string object");
25912 tmp = op->func_qualname;
25914 op->func_qualname = value;
25919 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED
void *closure)
25922 self = m->func_closure;
25929 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25931 if (unlikely(op->func_dict == NULL)) {
25932 op->func_dict = PyDict_New();
25933 if (unlikely(op->func_dict == NULL))
25936 Py_INCREF(op->func_dict);
25937 return op->func_dict;
25940 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED
void *context)
25943 if (unlikely(value == NULL)) {
25944 PyErr_SetString(PyExc_TypeError,
25945 "function's dictionary may not be deleted");
25948 if (unlikely(!PyDict_Check(value))) {
25949 PyErr_SetString(PyExc_TypeError,
25950 "setting function's dictionary to a non-dict");
25953 tmp = op->func_dict;
25955 op->func_dict = value;
25960 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25962 Py_INCREF(op->func_globals);
25963 return op->func_globals;
25966 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25968 Py_INCREF(Py_None);
25972 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context)
25974 PyObject* result = (op->func_code) ? op->func_code : Py_None;
25979 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25981 PyObject *res = op->defaults_getter((PyObject *) op);
25982 if (unlikely(!res))
25984 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25985 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25986 Py_INCREF(op->defaults_tuple);
25987 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25988 Py_INCREF(op->defaults_kwdict);
25990 op->defaults_tuple = PySequence_ITEM(res, 0);
25991 if (unlikely(!op->defaults_tuple)) result = -1;
25993 op->defaults_kwdict = PySequence_ITEM(res, 1);
25994 if (unlikely(!op->defaults_kwdict)) result = -1;
26001 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26005 }
else if (value != Py_None && !PyTuple_Check(value)) {
26006 PyErr_SetString(PyExc_TypeError,
26007 "__defaults__ must be set to a tuple object");
26011 tmp = op->defaults_tuple;
26012 op->defaults_tuple = value;
26017 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26018 PyObject* result = op->defaults_tuple;
26019 if (unlikely(!result)) {
26020 if (op->defaults_getter) {
26021 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26022 result = op->defaults_tuple;
26031 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26035 }
else if (value != Py_None && !PyDict_Check(value)) {
26036 PyErr_SetString(PyExc_TypeError,
26037 "__kwdefaults__ must be set to a dict object");
26041 tmp = op->defaults_kwdict;
26042 op->defaults_kwdict = value;
26047 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26048 PyObject* result = op->defaults_kwdict;
26049 if (unlikely(!result)) {
26050 if (op->defaults_getter) {
26051 if (__Pyx_CyFunction_init_defaults(op) < 0)
return NULL;
26052 result = op->defaults_kwdict;
26061 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED
void *context) {
26063 if (!value || value == Py_None) {
26065 }
else if (!PyDict_Check(value)) {
26066 PyErr_SetString(PyExc_TypeError,
26067 "__annotations__ must be set to a dict object");
26071 tmp = op->func_annotations;
26072 op->func_annotations = value;
26077 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED
void *context) {
26078 PyObject* result = op->func_annotations;
26079 if (unlikely(!result)) {
26080 result = PyDict_New();
26081 if (unlikely(!result))
return NULL;
26082 op->func_annotations = result;
26087 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26088 {(
char *)
"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26089 {(
char *)
"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26090 {(
char *)
"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26091 {(
char *)
"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26092 {(
char *)
"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26093 {(
char *)
"__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26094 {(
char *)
"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26095 {(
char *)
"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26096 {(
char *)
"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26097 {(
char *)
"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26098 {(
char *)
"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26099 {(
char *)
"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26100 {(
char *)
"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26101 {(
char *)
"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26102 {(
char *)
"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26103 {(
char *)
"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26104 {(
char *)
"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26105 {(
char *)
"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26108 static PyMemberDef __pyx_CyFunction_members[] = {
26109 {(
char *)
"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26113 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26115 #if PY_MAJOR_VERSION >= 3
26116 Py_INCREF(m->func_qualname);
26117 return m->func_qualname;
26119 return PyString_FromString(m->func.m_ml->ml_name);
26122 static PyMethodDef __pyx_CyFunction_methods[] = {
26123 {
"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26126 #if PY_VERSION_HEX < 0x030500A0
26127 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26129 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26131 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml,
int flags, PyObject* qualname,
26132 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26133 if (unlikely(op == NULL))
26136 __Pyx_CyFunction_weakreflist(op) = NULL;
26137 op->func.m_ml = ml;
26138 op->func.m_self = (PyObject *) op;
26139 Py_XINCREF(closure);
26140 op->func_closure = closure;
26141 Py_XINCREF(module);
26142 op->func.m_module = module;
26143 op->func_dict = NULL;
26144 op->func_name = NULL;
26145 Py_INCREF(qualname);
26146 op->func_qualname = qualname;
26147 op->func_doc = NULL;
26148 op->func_classobj = NULL;
26149 op->func_globals = globals;
26150 Py_INCREF(op->func_globals);
26152 op->func_code = code;
26153 op->defaults_pyobjects = 0;
26154 op->defaults_size = 0;
26155 op->defaults = NULL;
26156 op->defaults_tuple = NULL;
26157 op->defaults_kwdict = NULL;
26158 op->defaults_getter = NULL;
26159 op->func_annotations = NULL;
26160 return (PyObject *) op;
26163 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26165 Py_CLEAR(m->func_closure);
26166 Py_CLEAR(m->func.m_module);
26167 Py_CLEAR(m->func_dict);
26168 Py_CLEAR(m->func_name);
26169 Py_CLEAR(m->func_qualname);
26170 Py_CLEAR(m->func_doc);
26171 Py_CLEAR(m->func_globals);
26172 Py_CLEAR(m->func_code);
26173 Py_CLEAR(m->func_classobj);
26174 Py_CLEAR(m->defaults_tuple);
26175 Py_CLEAR(m->defaults_kwdict);
26176 Py_CLEAR(m->func_annotations);
26178 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26180 for (i = 0; i < m->defaults_pyobjects; i++)
26181 Py_XDECREF(pydefaults[i]);
26182 PyObject_Free(m->defaults);
26183 m->defaults = NULL;
26187 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26189 if (__Pyx_CyFunction_weakreflist(m) != NULL)
26190 PyObject_ClearWeakRefs((PyObject *) m);
26191 __Pyx_CyFunction_clear(m);
26192 PyObject_GC_Del(m);
26194 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26196 PyObject_GC_UnTrack(m);
26197 __Pyx__CyFunction_dealloc(m);
26199 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit,
void *arg)
26201 Py_VISIT(m->func_closure);
26202 Py_VISIT(m->func.m_module);
26203 Py_VISIT(m->func_dict);
26204 Py_VISIT(m->func_name);
26205 Py_VISIT(m->func_qualname);
26206 Py_VISIT(m->func_doc);
26207 Py_VISIT(m->func_globals);
26208 Py_VISIT(m->func_code);
26209 Py_VISIT(m->func_classobj);
26210 Py_VISIT(m->defaults_tuple);
26211 Py_VISIT(m->defaults_kwdict);
26213 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26215 for (i = 0; i < m->defaults_pyobjects; i++)
26216 Py_VISIT(pydefaults[i]);
26220 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26222 #if PY_MAJOR_VERSION < 3
26223 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26224 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26228 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26230 type = (PyObject *)(Py_TYPE(obj));
26231 return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26233 if (obj == Py_None)
26236 return __Pyx_PyMethod_New(func, obj, type);
26239 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26241 #if PY_MAJOR_VERSION >= 3
26242 return PyUnicode_FromFormat(
"<cyfunction %U at %p>",
26243 op->func_qualname, (
void *)op);
26245 return PyString_FromFormat(
"<cyfunction %s at %p>",
26246 PyString_AsString(op->func_qualname), (
void *)op);
26249 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *
self, PyObject *arg, PyObject *kw) {
26250 PyCFunctionObject* f = (PyCFunctionObject*)func;
26251 PyCFunction meth = f->m_ml->ml_meth;
26253 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26255 if (likely(kw == NULL || PyDict_Size(kw) == 0))
26256 return (*meth)(
self, arg);
26258 case METH_VARARGS | METH_KEYWORDS:
26259 return (*(PyCFunctionWithKeywords)(
void*)meth)(
self, arg, kw);
26261 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26262 size = PyTuple_GET_SIZE(arg);
26263 if (likely(size == 0))
26264 return (*meth)(
self, NULL);
26265 PyErr_Format(PyExc_TypeError,
26266 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26267 f->m_ml->ml_name, size);
26272 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26273 size = PyTuple_GET_SIZE(arg);
26274 if (likely(size == 1)) {
26275 PyObject *result, *arg0;
26276 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26277 arg0 = PyTuple_GET_ITEM(arg, 0);
26279 arg0 = PySequence_ITEM(arg, 0);
if (unlikely(!arg0))
return NULL;
26281 result = (*meth)(
self, arg0);
26282 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26287 PyErr_Format(PyExc_TypeError,
26288 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T
"d given)",
26289 f->m_ml->ml_name, size);
26294 PyErr_SetString(PyExc_SystemError,
"Bad call flags in "
26295 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26296 "longer supported!");
26299 PyErr_Format(PyExc_TypeError,
"%.200s() takes no keyword arguments",
26303 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26304 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26306 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26308 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26309 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26311 PyObject *new_args;
26313 argc = PyTuple_GET_SIZE(args);
26314 new_args = PyTuple_GetSlice(args, 1, argc);
26315 if (unlikely(!new_args))
26317 self = PyTuple_GetItem(args, 0);
26318 if (unlikely(!
self)) {
26319 Py_DECREF(new_args);
26322 result = __Pyx_CyFunction_CallMethod(func,
self, new_args, kw);
26323 Py_DECREF(new_args);
26325 result = __Pyx_CyFunction_Call(func, args, kw);
26329 static PyTypeObject __pyx_CyFunctionType_type = {
26330 PyVarObject_HEAD_INIT(0, 0)
26331 "cython_function_or_method",
26332 sizeof(__pyx_CyFunctionObject),
26334 (destructor) __Pyx_CyFunction_dealloc,
26338 #if PY_MAJOR_VERSION < 3
26343 (reprfunc) __Pyx_CyFunction_repr,
26348 __Pyx_CyFunction_CallAsMethod,
26353 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26355 (traverseproc) __Pyx_CyFunction_traverse,
26356 (inquiry) __Pyx_CyFunction_clear,
26358 #
if PY_VERSION_HEX < 0x030500A0
26359 offsetof(__pyx_CyFunctionObject, func_weakreflist),
26361 offsetof(PyCFunctionObject, m_weakreflist),
26365 __pyx_CyFunction_methods,
26366 __pyx_CyFunction_members,
26367 __pyx_CyFunction_getsets,
26370 __Pyx_CyFunction_descr_get,
26372 offsetof(__pyx_CyFunctionObject, func_dict),
26385 #if PY_VERSION_HEX >= 0x030400a1
26388 #if PY_VERSION_HEX >= 0x030800b1
26391 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26395 static int __pyx_CyFunction_init(
void) {
26396 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26397 if (unlikely(__pyx_CyFunctionType == NULL)) {
26402 static CYTHON_INLINE
void *__Pyx_CyFunction_InitDefaults(PyObject *func,
size_t size,
int pyobjects) {
26403 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26404 m->defaults = PyObject_Malloc(size);
26405 if (unlikely(!m->defaults))
26406 return PyErr_NoMemory();
26407 memset(m->defaults, 0, size);
26408 m->defaults_pyobjects = pyobjects;
26409 m->defaults_size = size;
26410 return m->defaults;
26412 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26413 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26414 m->defaults_tuple = tuple;
26417 static CYTHON_INLINE
void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26418 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26419 m->defaults_kwdict = dict;
26422 static CYTHON_INLINE
void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26423 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26424 m->func_annotations = dict;
26429 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
26430 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26431 PyObject *op = __Pyx_CyFunction_Init(
26432 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26433 ml, flags, qualname, closure, module, globals, code
26436 PyObject_GC_Track(op);
26442 #ifndef CYTHON_CLINE_IN_TRACEBACK
26443 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate,
int c_line) {
26444 PyObject *use_cline;
26445 PyObject *ptype, *pvalue, *ptraceback;
26446 #if CYTHON_COMPILING_IN_CPYTHON
26447 PyObject **cython_runtime_dict;
26449 if (unlikely(!__pyx_cython_runtime)) {
26452 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26453 #if CYTHON_COMPILING_IN_CPYTHON
26454 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26455 if (likely(cython_runtime_dict)) {
26456 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26457 use_cline, *cython_runtime_dict,
26458 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26462 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26463 if (use_cline_obj) {
26464 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26465 Py_DECREF(use_cline_obj);
26473 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26475 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26478 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26484 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
26485 int start = 0, mid = 0, end = count - 1;
26486 if (end >= 0 && code_line > entries[end].code_line) {
26489 while (start < end) {
26490 mid = start + (end - start) / 2;
26491 if (code_line < entries[mid].code_line) {
26493 }
else if (code_line > entries[mid].code_line) {
26499 if (code_line <= entries[mid].code_line) {
26505 static PyCodeObject *__pyx_find_code_object(
int code_line) {
26506 PyCodeObject* code_object;
26508 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26511 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26512 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26515 code_object = __pyx_code_cache.entries[pos].code_object;
26516 Py_INCREF(code_object);
26517 return code_object;
26519 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
26521 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26522 if (unlikely(!code_line)) {
26525 if (unlikely(!entries)) {
26526 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
26527 if (likely(entries)) {
26528 __pyx_code_cache.entries = entries;
26529 __pyx_code_cache.max_count = 64;
26530 __pyx_code_cache.count = 1;
26531 entries[0].code_line = code_line;
26532 entries[0].code_object = code_object;
26533 Py_INCREF(code_object);
26537 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26538 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26539 PyCodeObject* tmp = entries[pos].code_object;
26540 entries[pos].code_object = code_object;
26544 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26545 int new_max = __pyx_code_cache.max_count + 64;
26546 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26547 __pyx_code_cache.entries, ((
size_t)new_max) *
sizeof(__Pyx_CodeObjectCacheEntry));
26548 if (unlikely(!entries)) {
26551 __pyx_code_cache.entries = entries;
26552 __pyx_code_cache.max_count = new_max;
26554 for (i=__pyx_code_cache.count; i>pos; i--) {
26555 entries[i] = entries[i-1];
26557 entries[pos].code_line = code_line;
26558 entries[pos].code_object = code_object;
26559 __pyx_code_cache.count++;
26560 Py_INCREF(code_object);
26564 #include "compile.h"
26565 #include "frameobject.h"
26566 #include "traceback.h"
26567 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26568 const char *funcname,
int c_line,
26569 int py_line,
const char *filename) {
26570 PyCodeObject *py_code = 0;
26571 PyObject *py_srcfile = 0;
26572 PyObject *py_funcname = 0;
26573 #if PY_MAJOR_VERSION < 3
26574 py_srcfile = PyString_FromString(filename);
26576 py_srcfile = PyUnicode_FromString(filename);
26578 if (!py_srcfile)
goto bad;
26580 #if PY_MAJOR_VERSION < 3
26581 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26583 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26587 #if PY_MAJOR_VERSION < 3
26588 py_funcname = PyString_FromString(funcname);
26590 py_funcname = PyUnicode_FromString(funcname);
26593 if (!py_funcname)
goto bad;
26594 py_code = __Pyx_PyCode_New(
26611 Py_DECREF(py_srcfile);
26612 Py_DECREF(py_funcname);
26615 Py_XDECREF(py_srcfile);
26616 Py_XDECREF(py_funcname);
26619 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
26620 int py_line,
const char *filename) {
26621 PyCodeObject *py_code = 0;
26622 PyFrameObject *py_frame = 0;
26623 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26625 c_line = __Pyx_CLineForTraceback(tstate, c_line);
26627 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26629 py_code = __Pyx_CreateCodeObjectForTraceback(
26630 funcname, c_line, py_line, filename);
26631 if (!py_code)
goto bad;
26632 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26634 py_frame = PyFrame_New(
26640 if (!py_frame)
goto bad;
26641 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26642 PyTraceBack_Here(py_frame);
26644 Py_XDECREF(py_code);
26645 Py_XDECREF(py_frame);
26648 #if PY_MAJOR_VERSION < 3
26649 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
26650 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
26651 if (__Pyx_TypeCheck(obj, __pyx_array_type))
return __pyx_array_getbuffer(obj, view, flags);
26652 if (__Pyx_TypeCheck(obj, __pyx_memoryview_type))
return __pyx_memoryview_getbuffer(obj, view, flags);
26653 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26656 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26657 PyObject *obj = view->obj;
26659 if (PyObject_CheckBuffer(obj)) {
26660 PyBuffer_Release(view);
26672 __pyx_memviewslice_is_contig(
const __Pyx_memviewslice mvs,
char order,
int ndim)
26674 int i, index, step, start;
26675 Py_ssize_t itemsize = mvs.memview->view.itemsize;
26676 if (order ==
'F') {
26683 for (i = 0; i < ndim; i++) {
26684 index = start + step * i;
26685 if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26687 itemsize *= mvs.shape[index];
26694 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26695 void **out_start,
void **out_end,
26696 int ndim,
size_t itemsize)
26700 start = end = slice->data;
26701 for (i = 0; i < ndim; i++) {
26702 Py_ssize_t stride = slice->strides[i];
26703 Py_ssize_t extent = slice->shape[i];
26705 *out_start = *out_end = start;
26709 end += stride * (extent - 1);
26711 start += stride * (extent - 1);
26714 *out_start = start;
26715 *out_end = end + itemsize;
26718 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26719 __Pyx_memviewslice *slice2,
26720 int ndim,
size_t itemsize)
26722 void *start1, *end1, *start2, *end2;
26723 __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26724 __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26725 return (start1 < end2) && (start2 < end1);
26729 static CYTHON_INLINE PyObject *
26730 __pyx_capsule_create(
void *p, CYTHON_UNUSED
const char *sig)
26733 #if PY_VERSION_HEX >= 0x02070000
26734 cobj = PyCapsule_New(p, sig, NULL);
26736 cobj = PyCObject_FromVoidPtr(p, NULL);
26742 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26743 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26744 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26745 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26746 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26748 func_type value = func_value;\
26749 if (sizeof(target_type) < sizeof(func_type)) {\
26750 if (unlikely(value != (func_type) (target_type) value)) {\
26751 func_type zero = 0;\
26752 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26753 return (target_type) -1;\
26754 if (is_unsigned && unlikely(value < zero))\
26755 goto raise_neg_overflow;\
26757 goto raise_overflow;\
26760 return (target_type) value;\
26764 static CYTHON_INLINE
int __Pyx_Is_Little_Endian(
void)
26770 S.u32 = 0x01020304;
26771 return S.u8[0] == 4;
26775 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26776 __Pyx_BufFmt_StackElem* stack,
26777 __Pyx_TypeInfo* type) {
26778 stack[0].field = &ctx->root;
26779 stack[0].parent_offset = 0;
26780 ctx->root.type = type;
26781 ctx->root.name =
"buffer dtype";
26782 ctx->root.offset = 0;
26784 ctx->head->field = &ctx->root;
26785 ctx->fmt_offset = 0;
26786 ctx->head->parent_offset = 0;
26787 ctx->new_packmode =
'@';
26788 ctx->enc_packmode =
'@';
26789 ctx->new_count = 1;
26790 ctx->enc_count = 0;
26792 ctx->is_complex = 0;
26793 ctx->is_valid_array = 0;
26794 ctx->struct_alignment = 0;
26795 while (type->typegroup ==
'S') {
26797 ctx->head->field = type->fields;
26798 ctx->head->parent_offset = 0;
26799 type = type->fields->type;
26802 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
26804 const char* t = *ts;
26805 if (*t < '0' || *t >
'9') {
26808 count = *t++ -
'0';
26809 while (*t >=
'0' && *t <=
'9') {
26811 count += *t++ -
'0';
26817 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
26818 int number = __Pyx_BufFmt_ParseNumber(ts);
26820 PyErr_Format(PyExc_ValueError,\
26821 "Does not understand character buffer dtype format string ('%c')", **ts);
26824 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
26825 PyErr_Format(PyExc_ValueError,
26826 "Unexpected format string character: '%c'", ch);
26828 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
26830 case '?':
return "'bool'";
26831 case 'c':
return "'char'";
26832 case 'b':
return "'signed char'";
26833 case 'B':
return "'unsigned char'";
26834 case 'h':
return "'short'";
26835 case 'H':
return "'unsigned short'";
26836 case 'i':
return "'int'";
26837 case 'I':
return "'unsigned int'";
26838 case 'l':
return "'long'";
26839 case 'L':
return "'unsigned long'";
26840 case 'q':
return "'long long'";
26841 case 'Q':
return "'unsigned long long'";
26842 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
26843 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
26844 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
26845 case 'T':
return "a struct";
26846 case 'O':
return "Python object";
26847 case 'P':
return "a pointer";
26848 case 's':
case 'p':
return "a string";
26849 case 0:
return "end";
26850 default:
return "unparseable format string";
26853 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
26855 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26856 case 'h':
case 'H':
return 2;
26857 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
26858 case 'q':
case 'Q':
return 8;
26859 case 'f':
return (is_complex ? 8 : 4);
26860 case 'd':
return (is_complex ? 16 : 8);
26862 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
26865 case 'O':
case 'P':
return sizeof(
void*);
26867 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26871 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
26873 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26874 case 'h':
case 'H':
return sizeof(short);
26875 case 'i':
case 'I':
return sizeof(int);
26876 case 'l':
case 'L':
return sizeof(long);
26877 #ifdef HAVE_LONG_LONG
26878 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
26880 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
26881 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
26882 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
26883 case 'O':
case 'P':
return sizeof(
void*);
26885 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26890 typedef struct {
char c;
short x; } __Pyx_st_short;
26891 typedef struct {
char c;
int x; } __Pyx_st_int;
26892 typedef struct {
char c;
long x; } __Pyx_st_long;
26893 typedef struct {
char c;
float x; } __Pyx_st_float;
26894 typedef struct {
char c;
double x; } __Pyx_st_double;
26895 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
26896 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
26897 #ifdef HAVE_LONG_LONG
26898 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26900 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
26902 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26903 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
26904 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
26905 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
26906 #ifdef HAVE_LONG_LONG
26907 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
26909 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
26910 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
26911 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
26912 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
26914 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26922 typedef struct {
short x;
char c; } __Pyx_pad_short;
26923 typedef struct {
int x;
char c; } __Pyx_pad_int;
26924 typedef struct {
long x;
char c; } __Pyx_pad_long;
26925 typedef struct {
float x;
char c; } __Pyx_pad_float;
26926 typedef struct {
double x;
char c; } __Pyx_pad_double;
26927 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
26928 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
26929 #ifdef HAVE_LONG_LONG
26930 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
26932 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
26934 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
26935 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
26936 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
26937 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
26938 #ifdef HAVE_LONG_LONG
26939 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
26941 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
26942 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
26943 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
26944 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
26946 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26950 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
26954 case 'b':
case 'h':
case 'i':
26955 case 'l':
case 'q':
case 's':
case 'p':
26957 case '?':
case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
26959 case 'f':
case 'd':
case 'g':
26960 return (is_complex ?
'C' :
'R');
26966 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26971 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26972 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26973 const char* expected;
26975 if (ctx->head == NULL) {
26979 expected = ctx->head->field->type->name;
26982 PyErr_Format(PyExc_ValueError,
26983 "Buffer dtype mismatch, expected %s%s%s but got %s",
26984 quote, expected, quote,
26985 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26987 __Pyx_StructField* field = ctx->head->field;
26988 __Pyx_StructField* parent = (ctx->head - 1)->field;
26989 PyErr_Format(PyExc_ValueError,
26990 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26991 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26992 parent->type->name, field->name);
26995 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26997 size_t size, offset, arraysize = 1;
26998 if (ctx->enc_type == 0)
return 0;
26999 if (ctx->head->field->type->arraysize[0]) {
27001 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
27002 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27004 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27005 PyErr_Format(PyExc_ValueError,
27006 "Expected a dimension of size %zu, got %zu",
27007 ctx->head->field->type->arraysize[0], ctx->enc_count);
27011 if (!ctx->is_valid_array) {
27012 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
27013 ctx->head->field->type->ndim, ndim);
27016 for (i = 0; i < ctx->head->field->type->ndim; i++) {
27017 arraysize *= ctx->head->field->type->arraysize[i];
27019 ctx->is_valid_array = 0;
27020 ctx->enc_count = 1;
27022 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27024 __Pyx_StructField* field = ctx->head->field;
27025 __Pyx_TypeInfo* type = field->type;
27026 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
27027 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27029 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27031 if (ctx->enc_packmode ==
'@') {
27032 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27033 size_t align_mod_offset;
27034 if (align_at == 0)
return -1;
27035 align_mod_offset = ctx->fmt_offset % align_at;
27036 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27037 if (ctx->struct_alignment == 0)
27038 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27041 if (type->size != size || type->typegroup != group) {
27042 if (type->typegroup ==
'C' && type->fields != NULL) {
27043 size_t parent_offset = ctx->head->parent_offset + field->offset;
27045 ctx->head->field = type->fields;
27046 ctx->head->parent_offset = parent_offset;
27049 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
27051 __Pyx_BufFmt_RaiseExpected(ctx);
27055 offset = ctx->head->parent_offset + field->offset;
27056 if (ctx->fmt_offset != offset) {
27057 PyErr_Format(PyExc_ValueError,
27058 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
27059 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27062 ctx->fmt_offset += size;
27064 ctx->fmt_offset += (arraysize - 1) * size;
27067 if (field == &ctx->root) {
27069 if (ctx->enc_count != 0) {
27070 __Pyx_BufFmt_RaiseExpected(ctx);
27075 ctx->head->field = ++field;
27076 if (field->type == NULL) {
27078 field = ctx->head->field;
27080 }
else if (field->type->typegroup ==
'S') {
27081 size_t parent_offset = ctx->head->parent_offset + field->offset;
27082 if (field->type->fields->type == NULL)
continue;
27083 field = field->type->fields;
27085 ctx->head->field = field;
27086 ctx->head->parent_offset = parent_offset;
27092 }
while (ctx->enc_count);
27094 ctx->is_complex = 0;
27098 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
27100 const char *ts = *tsp;
27101 int i = 0, number, ndim;
27103 if (ctx->new_count != 1) {
27104 PyErr_SetString(PyExc_ValueError,
27105 "Cannot handle repeated arrays in format string");
27108 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27109 ndim = ctx->head->field->type->ndim;
27110 while (*ts && *ts !=
')') {
27112 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
27115 number = __Pyx_BufFmt_ExpectNumber(&ts);
27116 if (number == -1)
return NULL;
27117 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
27118 return PyErr_Format(PyExc_ValueError,
27119 "Expected a dimension of size %zu, got %d",
27120 ctx->head->field->type->arraysize[i], number);
27121 if (*ts !=
',' && *ts !=
')')
27122 return PyErr_Format(PyExc_ValueError,
27123 "Expected a comma in format string, got '%c'", *ts);
27124 if (*ts ==
',') ts++;
27128 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
27129 ctx->head->field->type->ndim, i);
27131 PyErr_SetString(PyExc_ValueError,
27132 "Unexpected end of format string, expected ')'");
27135 ctx->is_valid_array = 1;
27136 ctx->new_count = 1;
27140 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
27145 if (ctx->enc_type != 0 && ctx->head == NULL) {
27146 __Pyx_BufFmt_RaiseExpected(ctx);
27149 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27150 if (ctx->head != NULL) {
27151 __Pyx_BufFmt_RaiseExpected(ctx);
27161 if (!__Pyx_Is_Little_Endian()) {
27162 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
27165 ctx->new_packmode =
'=';
27170 if (__Pyx_Is_Little_Endian()) {
27171 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
27174 ctx->new_packmode =
'=';
27180 ctx->new_packmode = *ts++;
27184 const char* ts_after_sub;
27185 size_t i, struct_count = ctx->new_count;
27186 size_t struct_alignment = ctx->struct_alignment;
27187 ctx->new_count = 1;
27190 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
27193 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27195 ctx->enc_count = 0;
27196 ctx->struct_alignment = 0;
27199 for (i = 0; i != struct_count; ++i) {
27200 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27201 if (!ts_after_sub)
return NULL;
27204 if (struct_alignment) ctx->struct_alignment = struct_alignment;
27209 size_t alignment = ctx->struct_alignment;
27211 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27213 if (alignment && ctx->fmt_offset % alignment) {
27214 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27219 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27220 ctx->fmt_offset += ctx->new_count;
27221 ctx->new_count = 1;
27222 ctx->enc_count = 0;
27224 ctx->enc_packmode = ctx->new_packmode;
27230 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
27231 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
27234 CYTHON_FALLTHROUGH;
27235 case '?':
case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
27236 case 'l':
case 'L':
case 'q':
case 'Q':
27237 case 'f':
case 'd':
case 'g':
27238 case 'O':
case 'p':
27239 if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27240 (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27241 ctx->enc_count += ctx->new_count;
27242 ctx->new_count = 1;
27247 CYTHON_FALLTHROUGH;
27249 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
27250 ctx->enc_count = ctx->new_count;
27251 ctx->enc_packmode = ctx->new_packmode;
27252 ctx->enc_type = *ts;
27253 ctx->is_complex = got_Z;
27255 ctx->new_count = 1;
27260 while(*ts !=
':') ++ts;
27264 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
27268 int number = __Pyx_BufFmt_ExpectNumber(&ts);
27269 if (number == -1)
return NULL;
27270 ctx->new_count = (size_t)number;
27278 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27285 if (a->size != b->size || a->typegroup != b->typegroup ||
27286 a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27287 if (a->typegroup ==
'H' || b->typegroup ==
'H') {
27288 return a->size == b->size;
27294 for (i = 0; i < a->ndim; i++)
27295 if (a->arraysize[i] != b->arraysize[i])
27298 if (a->typegroup ==
'S') {
27299 if (a->flags != b->flags)
27301 if (a->fields || b->fields) {
27302 if (!(a->fields && b->fields))
27304 for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27305 __Pyx_StructField *field_a = a->fields + i;
27306 __Pyx_StructField *field_b = b->fields + i;
27307 if (field_a->offset != field_b->offset ||
27308 !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27311 return !a->fields[i].type && !b->fields[i].type;
27319 __pyx_check_strides(Py_buffer *buf,
int dim,
int ndim,
int spec)
27321 if (buf->shape[dim] <= 1)
27323 if (buf->strides) {
27324 if (spec & __Pyx_MEMVIEW_CONTIG) {
27325 if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27326 if (unlikely(buf->strides[dim] !=
sizeof(
void *))) {
27327 PyErr_Format(PyExc_ValueError,
27328 "Buffer is not indirectly contiguous "
27329 "in dimension %d.", dim);
27332 }
else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27333 PyErr_SetString(PyExc_ValueError,
27334 "Buffer and memoryview are not contiguous "
27335 "in the same dimension.");
27339 if (spec & __Pyx_MEMVIEW_FOLLOW) {
27340 Py_ssize_t stride = buf->strides[dim];
27343 if (unlikely(stride < buf->itemsize)) {
27344 PyErr_SetString(PyExc_ValueError,
27345 "Buffer and memoryview are not contiguous "
27346 "in the same dimension.");
27351 if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27352 PyErr_Format(PyExc_ValueError,
27353 "C-contiguous buffer is not contiguous in "
27354 "dimension %d", dim);
27356 }
else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27357 PyErr_Format(PyExc_ValueError,
27358 "C-contiguous buffer is not indirect in "
27359 "dimension %d", dim);
27361 }
else if (unlikely(buf->suboffsets)) {
27362 PyErr_SetString(PyExc_ValueError,
27363 "Buffer exposes suboffsets but no strides");
27372 __pyx_check_suboffsets(Py_buffer *buf,
int dim, CYTHON_UNUSED
int ndim,
int spec)
27374 if (spec & __Pyx_MEMVIEW_DIRECT) {
27375 if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27376 PyErr_Format(PyExc_ValueError,
27377 "Buffer not compatible with direct access "
27378 "in dimension %d.", dim);
27382 if (spec & __Pyx_MEMVIEW_PTR) {
27383 if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
27384 PyErr_Format(PyExc_ValueError,
27385 "Buffer is not indirectly accessible "
27386 "in dimension %d.", dim);
27395 __pyx_verify_contig(Py_buffer *buf,
int ndim,
int c_or_f_flag)
27398 if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27399 Py_ssize_t stride = 1;
27400 for (i = 0; i < ndim; i++) {
27401 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27402 PyErr_SetString(PyExc_ValueError,
27403 "Buffer not fortran contiguous.");
27406 stride = stride * buf->shape[i];
27408 }
else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27409 Py_ssize_t stride = 1;
27410 for (i = ndim - 1; i >- 1; i--) {
27411 if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27412 PyErr_SetString(PyExc_ValueError,
27413 "Buffer not C contiguous.");
27416 stride = stride * buf->shape[i];
27423 static int __Pyx_ValidateAndInit_memviewslice(
27428 __Pyx_TypeInfo *dtype,
27429 __Pyx_BufFmt_StackElem stack[],
27430 __Pyx_memviewslice *memviewslice,
27431 PyObject *original_obj)
27433 struct __pyx_memoryview_obj *memview, *new_memview;
27434 __Pyx_RefNannyDeclarations
27436 int i, spec = 0, retval = -1;
27437 __Pyx_BufFmt_Context ctx;
27438 int from_memoryview = __pyx_memoryview_check(original_obj);
27439 __Pyx_RefNannySetupContext(
"ValidateAndInit_memviewslice", 0);
27440 if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((
struct __pyx_memoryview_obj *)
27441 original_obj)->typeinfo)) {
27442 memview = (
struct __pyx_memoryview_obj *) original_obj;
27443 new_memview = NULL;
27445 memview = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27446 original_obj, buf_flags, 0, dtype);
27447 new_memview = memview;
27448 if (unlikely(!memview))
27451 buf = &memview->view;
27452 if (unlikely(buf->ndim != ndim)) {
27453 PyErr_Format(PyExc_ValueError,
27454 "Buffer has wrong number of dimensions (expected %d, got %d)",
27459 __Pyx_BufFmt_Init(&ctx, stack, dtype);
27460 if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format)))
goto fail;
27462 if (unlikely((
unsigned) buf->itemsize != dtype->size)) {
27463 PyErr_Format(PyExc_ValueError,
27464 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"u byte%s) "
27465 "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"u byte%s)",
27467 (buf->itemsize > 1) ?
"s" :
"",
27470 (dtype->size > 1) ?
"s" :
"");
27473 if (buf->len > 0) {
27474 for (i = 0; i < ndim; i++) {
27475 spec = axes_specs[i];
27476 if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
27478 if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
27481 if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
27484 if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27485 new_memview != NULL) == -1)) {
27491 Py_XDECREF(new_memview);
27494 __Pyx_RefNannyFinishContext();
27499 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj,
int writable_flag) {
27500 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27501 __Pyx_BufFmt_StackElem stack[1];
27502 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27504 if (obj == Py_None) {
27505 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27508 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27509 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27510 &__Pyx_TypeInfo_float, stack,
27512 if (unlikely(retcode == -1))
27516 result.memview = NULL;
27517 result.data = NULL;
27522 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj,
int writable_flag) {
27523 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27524 __Pyx_BufFmt_StackElem stack[1];
27525 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27527 if (obj == Py_None) {
27528 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27531 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27532 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27533 &__Pyx_TypeInfo_float, stack,
27535 if (unlikely(retcode == -1))
27539 result.memview = NULL;
27540 result.data = NULL;
27545 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj,
int writable_flag) {
27546 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27547 __Pyx_BufFmt_StackElem stack[1];
27548 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27550 if (obj == Py_None) {
27551 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27554 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27555 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27556 &__Pyx_TypeInfo_double, stack,
27558 if (unlikely(retcode == -1))
27562 result.memview = NULL;
27563 result.data = NULL;
27568 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj,
int writable_flag) {
27569 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27570 __Pyx_BufFmt_StackElem stack[1];
27571 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27573 if (obj == Py_None) {
27574 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27577 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27578 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27579 &__Pyx_TypeInfo_double, stack,
27581 if (unlikely(retcode == -1))
27585 result.memview = NULL;
27586 result.data = NULL;
27591 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj,
int writable_flag) {
27592 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27593 __Pyx_BufFmt_StackElem stack[1];
27594 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27596 if (obj == Py_None) {
27597 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27600 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27601 (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27602 &__Pyx_TypeInfo_long__double, stack,
27604 if (unlikely(retcode == -1))
27608 result.memview = NULL;
27609 result.data = NULL;
27614 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *obj,
int writable_flag) {
27615 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27616 __Pyx_BufFmt_StackElem stack[1];
27617 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27619 if (obj == Py_None) {
27620 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27623 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27624 (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27625 &__Pyx_TypeInfo_long__double, stack,
27627 if (unlikely(retcode == -1))
27631 result.memview = NULL;
27632 result.data = NULL;
27637 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj,
int writable_flag) {
27638 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27639 __Pyx_BufFmt_StackElem stack[1];
27640 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27642 if (obj == Py_None) {
27643 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27646 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27647 PyBUF_RECORDS_RO | writable_flag, 1,
27648 &__Pyx_TypeInfo_int, stack,
27650 if (unlikely(retcode == -1))
27654 result.memview = NULL;
27655 result.data = NULL;
27660 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj,
int writable_flag) {
27661 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27662 __Pyx_BufFmt_StackElem stack[1];
27663 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27665 if (obj == Py_None) {
27666 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27669 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27670 PyBUF_RECORDS_RO | writable_flag, 1,
27671 &__Pyx_TypeInfo_float, stack,
27673 if (unlikely(retcode == -1))
27677 result.memview = NULL;
27678 result.data = NULL;
27683 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj,
int writable_flag) {
27684 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27685 __Pyx_BufFmt_StackElem stack[1];
27686 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27688 if (obj == Py_None) {
27689 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27692 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27693 PyBUF_RECORDS_RO | writable_flag, 1,
27694 &__Pyx_TypeInfo_double, stack,
27696 if (unlikely(retcode == -1))
27700 result.memview = NULL;
27701 result.data = NULL;
27706 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj,
int writable_flag) {
27707 __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27708 __Pyx_BufFmt_StackElem stack[1];
27709 int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27711 if (obj == Py_None) {
27712 result.memview = (
struct __pyx_memoryview_obj *) Py_None;
27715 retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27716 PyBUF_RECORDS_RO | writable_flag, 1,
27717 &__Pyx_TypeInfo_long__double, stack,
27719 if (unlikely(retcode == -1))
27723 result.memview = NULL;
27724 result.data = NULL;
27729 static __Pyx_memviewslice
27730 __pyx_memoryview_copy_new_contig(
const __Pyx_memviewslice *from_mvs,
27731 const char *mode,
int ndim,
27732 size_t sizeof_dtype,
int contig_flag,
27733 int dtype_is_object)
27735 __Pyx_RefNannyDeclarations
27737 __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27738 struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27739 Py_buffer *buf = &from_memview->view;
27740 PyObject *shape_tuple = NULL;
27741 PyObject *temp_int = NULL;
27742 struct __pyx_array_obj *array_obj = NULL;
27743 struct __pyx_memoryview_obj *memview_obj = NULL;
27744 __Pyx_RefNannySetupContext(
"__pyx_memoryview_copy_new_contig", 0);
27745 for (i = 0; i < ndim; i++) {
27746 if (unlikely(from_mvs->suboffsets[i] >= 0)) {
27747 PyErr_Format(PyExc_ValueError,
"Cannot copy memoryview slice with "
27748 "indirect dimensions (axis %d)", i);
27752 shape_tuple = PyTuple_New(ndim);
27753 if (unlikely(!shape_tuple)) {
27756 __Pyx_GOTREF(shape_tuple);
27757 for(i = 0; i < ndim; i++) {
27758 temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27759 if(unlikely(!temp_int)) {
27762 PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27766 array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (
char *) mode, NULL);
27767 if (unlikely(!array_obj)) {
27770 __Pyx_GOTREF(array_obj);
27771 memview_obj = (
struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27772 (PyObject *) array_obj, contig_flag,
27774 from_mvs->memview->typeinfo);
27775 if (unlikely(!memview_obj))
27777 if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27779 if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27780 dtype_is_object) < 0))
27784 __Pyx_XDECREF(new_mvs.memview);
27785 new_mvs.memview = NULL;
27786 new_mvs.data = NULL;
27788 __Pyx_XDECREF(shape_tuple);
27789 __Pyx_XDECREF(temp_int);
27790 __Pyx_XDECREF(array_obj);
27791 __Pyx_RefNannyFinishContext();
27796 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
27797 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27798 #pragma GCC diagnostic push
27799 #pragma GCC diagnostic ignored "-Wconversion"
27801 const long neg_one = (long) -1, const_zero = (
long) 0;
27802 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27803 #pragma GCC diagnostic pop
27805 const int is_unsigned = neg_one > const_zero;
27807 if (
sizeof(
long) <
sizeof(long)) {
27808 return PyInt_FromLong((
long) value);
27809 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
27810 return PyLong_FromUnsignedLong((
unsigned long) value);
27811 #ifdef HAVE_LONG_LONG
27812 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
27813 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
27817 if (
sizeof(
long) <=
sizeof(
long)) {
27818 return PyInt_FromLong((
long) value);
27819 #ifdef HAVE_LONG_LONG
27820 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
27821 return PyLong_FromLongLong((PY_LONG_LONG) value);
27826 int one = 1;
int little = (int)*(
unsigned char *)&one;
27827 unsigned char *bytes = (
unsigned char *)&value;
27828 return _PyLong_FromByteArray(bytes,
sizeof(
long),
27829 little, !is_unsigned);
27834 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
27835 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27836 #pragma GCC diagnostic push
27837 #pragma GCC diagnostic ignored "-Wconversion"
27839 const int neg_one = (int) -1, const_zero = (
int) 0;
27840 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27841 #pragma GCC diagnostic pop
27843 const int is_unsigned = neg_one > const_zero;
27844 #if PY_MAJOR_VERSION < 3
27845 if (likely(PyInt_Check(x))) {
27846 if (
sizeof(
int) <
sizeof(long)) {
27847 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
27849 long val = PyInt_AS_LONG(x);
27850 if (is_unsigned && unlikely(val < 0)) {
27851 goto raise_neg_overflow;
27857 if (likely(PyLong_Check(x))) {
27859 #if CYTHON_USE_PYLONG_INTERNALS
27860 const digit* digits = ((PyLongObject*)x)->ob_digit;
27861 switch (Py_SIZE(x)) {
27862 case 0:
return (
int) 0;
27863 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
27865 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27866 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27867 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27868 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
27869 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27874 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27875 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27876 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27877 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
27878 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27883 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27884 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27885 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27886 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
27887 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
27893 #if CYTHON_COMPILING_IN_CPYTHON
27894 if (unlikely(Py_SIZE(x) < 0)) {
27895 goto raise_neg_overflow;
27899 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27900 if (unlikely(result < 0))
27902 if (unlikely(result == 1))
27903 goto raise_neg_overflow;
27906 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
27907 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
27908 #ifdef HAVE_LONG_LONG
27909 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
27910 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27914 #if CYTHON_USE_PYLONG_INTERNALS
27915 const digit* digits = ((PyLongObject*)x)->ob_digit;
27916 switch (Py_SIZE(x)) {
27917 case 0:
return (
int) 0;
27918 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, (sdigit) (-(sdigit)digits[0]))
27919 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
27921 if (8 *
sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
27922 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27923 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27924 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27925 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27930 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
27931 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
27932 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27933 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27934 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27939 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
27940 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27941 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27942 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27943 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27948 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
27949 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
27950 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27951 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27952 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27957 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
27958 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27959 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27960 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27961 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27966 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
27967 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
27968 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
27969 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
27970 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
27976 if (
sizeof(
int) <=
sizeof(long)) {
27977 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
27978 #ifdef HAVE_LONG_LONG
27979 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
27980 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
27985 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27986 PyErr_SetString(PyExc_RuntimeError,
27987 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27990 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27991 #if PY_MAJOR_VERSION < 3
27992 if (likely(v) && !PyLong_Check(v)) {
27994 v = PyNumber_Long(tmp);
27999 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28000 unsigned char *bytes = (
unsigned char *)&val;
28001 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28002 bytes,
sizeof(val),
28003 is_little, !is_unsigned);
28013 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28014 if (!tmp)
return (
int) -1;
28015 val = __Pyx_PyInt_As_int(tmp);
28020 PyErr_SetString(PyExc_OverflowError,
28021 "value too large to convert to int");
28023 raise_neg_overflow:
28024 PyErr_SetString(PyExc_OverflowError,
28025 "can't convert negative value to int");
28030 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
28031 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28032 #pragma GCC diagnostic push
28033 #pragma GCC diagnostic ignored "-Wconversion"
28035 const long neg_one = (long) -1, const_zero = (
long) 0;
28036 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28037 #pragma GCC diagnostic pop
28039 const int is_unsigned = neg_one > const_zero;
28040 #if PY_MAJOR_VERSION < 3
28041 if (likely(PyInt_Check(x))) {
28042 if (
sizeof(
long) <
sizeof(long)) {
28043 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
28045 long val = PyInt_AS_LONG(x);
28046 if (is_unsigned && unlikely(val < 0)) {
28047 goto raise_neg_overflow;
28053 if (likely(PyLong_Check(x))) {
28055 #if CYTHON_USE_PYLONG_INTERNALS
28056 const digit* digits = ((PyLongObject*)x)->ob_digit;
28057 switch (Py_SIZE(x)) {
28058 case 0:
return (
long) 0;
28059 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
28061 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28062 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28063 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28064 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
28065 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28070 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28071 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28072 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28073 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
28074 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28079 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28080 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28081 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28082 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
28083 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
28089 #if CYTHON_COMPILING_IN_CPYTHON
28090 if (unlikely(Py_SIZE(x) < 0)) {
28091 goto raise_neg_overflow;
28095 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28096 if (unlikely(result < 0))
28098 if (unlikely(result == 1))
28099 goto raise_neg_overflow;
28102 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
28103 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
28104 #ifdef HAVE_LONG_LONG
28105 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
28106 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28110 #if CYTHON_USE_PYLONG_INTERNALS
28111 const digit* digits = ((PyLongObject*)x)->ob_digit;
28112 switch (Py_SIZE(x)) {
28113 case 0:
return (
long) 0;
28114 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, (sdigit) (-(sdigit)digits[0]))
28115 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
28117 if (8 *
sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
28118 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28119 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28120 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28121 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28126 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
28127 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28128 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28129 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28130 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28135 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
28136 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28137 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28138 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28139 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28144 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
28145 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28146 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28147 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28148 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28153 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
28154 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28155 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28156 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28157 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28162 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
28163 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28164 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28165 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
28166 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
28172 if (
sizeof(
long) <=
sizeof(long)) {
28173 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
28174 #ifdef HAVE_LONG_LONG
28175 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
28176 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
28181 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28182 PyErr_SetString(PyExc_RuntimeError,
28183 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28186 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28187 #if PY_MAJOR_VERSION < 3
28188 if (likely(v) && !PyLong_Check(v)) {
28190 v = PyNumber_Long(tmp);
28195 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28196 unsigned char *bytes = (
unsigned char *)&val;
28197 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28198 bytes,
sizeof(val),
28199 is_little, !is_unsigned);
28209 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28210 if (!tmp)
return (
long) -1;
28211 val = __Pyx_PyInt_As_long(tmp);
28216 PyErr_SetString(PyExc_OverflowError,
28217 "value too large to convert to long");
28219 raise_neg_overflow:
28220 PyErr_SetString(PyExc_OverflowError,
28221 "can't convert negative value to long");
28226 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
28227 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28228 #pragma GCC diagnostic push
28229 #pragma GCC diagnostic ignored "-Wconversion"
28231 const int neg_one = (int) -1, const_zero = (
int) 0;
28232 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28233 #pragma GCC diagnostic pop
28235 const int is_unsigned = neg_one > const_zero;
28237 if (
sizeof(
int) <
sizeof(long)) {
28238 return PyInt_FromLong((
long) value);
28239 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
28240 return PyLong_FromUnsignedLong((
unsigned long) value);
28241 #ifdef HAVE_LONG_LONG
28242 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
28243 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
28247 if (
sizeof(
int) <=
sizeof(
long)) {
28248 return PyInt_FromLong((
long) value);
28249 #ifdef HAVE_LONG_LONG
28250 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
28251 return PyLong_FromLongLong((PY_LONG_LONG) value);
28256 int one = 1;
int little = (int)*(
unsigned char *)&one;
28257 unsigned char *bytes = (
unsigned char *)&value;
28258 return _PyLong_FromByteArray(bytes,
sizeof(
int),
28259 little, !is_unsigned);
28264 static CYTHON_INLINE
char __Pyx_PyInt_As_char(PyObject *x) {
28265 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28266 #pragma GCC diagnostic push
28267 #pragma GCC diagnostic ignored "-Wconversion"
28269 const char neg_one = (char) -1, const_zero = (
char) 0;
28270 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28271 #pragma GCC diagnostic pop
28273 const int is_unsigned = neg_one > const_zero;
28274 #if PY_MAJOR_VERSION < 3
28275 if (likely(PyInt_Check(x))) {
28276 if (
sizeof(
char) <
sizeof(long)) {
28277 __PYX_VERIFY_RETURN_INT(
char,
long, PyInt_AS_LONG(x))
28279 long val = PyInt_AS_LONG(x);
28280 if (is_unsigned && unlikely(val < 0)) {
28281 goto raise_neg_overflow;
28287 if (likely(PyLong_Check(x))) {
28289 #if CYTHON_USE_PYLONG_INTERNALS
28290 const digit* digits = ((PyLongObject*)x)->ob_digit;
28291 switch (Py_SIZE(x)) {
28292 case 0:
return (
char) 0;
28293 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, digits[0])
28295 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28296 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28297 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28298 }
else if (8 *
sizeof(
char) >= 2 * PyLong_SHIFT) {
28299 return (
char) (((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28304 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28305 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28306 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28307 }
else if (8 *
sizeof(
char) >= 3 * PyLong_SHIFT) {
28308 return (
char) (((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28313 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28314 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28315 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28316 }
else if (8 *
sizeof(
char) >= 4 * PyLong_SHIFT) {
28317 return (
char) (((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0]));
28323 #if CYTHON_COMPILING_IN_CPYTHON
28324 if (unlikely(Py_SIZE(x) < 0)) {
28325 goto raise_neg_overflow;
28329 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28330 if (unlikely(result < 0))
28332 if (unlikely(result == 1))
28333 goto raise_neg_overflow;
28336 if (
sizeof(
char) <=
sizeof(
unsigned long)) {
28337 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned long, PyLong_AsUnsignedLong(x))
28338 #ifdef HAVE_LONG_LONG
28339 }
else if (
sizeof(
char) <=
sizeof(
unsigned PY_LONG_LONG)) {
28340 __PYX_VERIFY_RETURN_INT_EXC(
char,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28344 #if CYTHON_USE_PYLONG_INTERNALS
28345 const digit* digits = ((PyLongObject*)x)->ob_digit;
28346 switch (Py_SIZE(x)) {
28347 case 0:
return (
char) 0;
28348 case -1: __PYX_VERIFY_RETURN_INT(
char, sdigit, (sdigit) (-(sdigit)digits[0]))
28349 case 1: __PYX_VERIFY_RETURN_INT(
char, digit, +digits[0])
28351 if (8 *
sizeof(
char) - 1 > 1 * PyLong_SHIFT) {
28352 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28353 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28354 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28355 return (
char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28360 if (8 *
sizeof(
char) > 1 * PyLong_SHIFT) {
28361 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
28362 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28363 }
else if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28364 return (
char) ((((((char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28369 if (8 *
sizeof(
char) - 1 > 2 * PyLong_SHIFT) {
28370 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28371 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28372 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28373 return (
char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28378 if (8 *
sizeof(
char) > 2 * PyLong_SHIFT) {
28379 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
28380 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28381 }
else if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28382 return (
char) ((((((((char)digits[2]) << PyLong_SHIFT) | (
char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28387 if (8 *
sizeof(
char) - 1 > 3 * PyLong_SHIFT) {
28388 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28389 __PYX_VERIFY_RETURN_INT(
char,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28390 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28391 return (
char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28396 if (8 *
sizeof(
char) > 3 * PyLong_SHIFT) {
28397 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
28398 __PYX_VERIFY_RETURN_INT(
char,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
28399 }
else if (8 *
sizeof(
char) - 1 > 4 * PyLong_SHIFT) {
28400 return (
char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (
char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (
char)digits[0])));
28406 if (
sizeof(
char) <=
sizeof(long)) {
28407 __PYX_VERIFY_RETURN_INT_EXC(
char,
long, PyLong_AsLong(x))
28408 #ifdef HAVE_LONG_LONG
28409 }
else if (
sizeof(
char) <=
sizeof(PY_LONG_LONG)) {
28410 __PYX_VERIFY_RETURN_INT_EXC(
char, PY_LONG_LONG, PyLong_AsLongLong(x))
28415 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28416 PyErr_SetString(PyExc_RuntimeError,
28417 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28420 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28421 #if PY_MAJOR_VERSION < 3
28422 if (likely(v) && !PyLong_Check(v)) {
28424 v = PyNumber_Long(tmp);
28429 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
28430 unsigned char *bytes = (
unsigned char *)&val;
28431 int ret = _PyLong_AsByteArray((PyLongObject *)v,
28432 bytes,
sizeof(val),
28433 is_little, !is_unsigned);
28443 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28444 if (!tmp)
return (
char) -1;
28445 val = __Pyx_PyInt_As_char(tmp);
28450 PyErr_SetString(PyExc_OverflowError,
28451 "value too large to convert to char");
28453 raise_neg_overflow:
28454 PyErr_SetString(PyExc_OverflowError,
28455 "can't convert negative value to char");
28460 static int __Pyx_check_binary_version(
void) {
28461 char ctversion[4], rtversion[4];
28462 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28463 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
28464 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28466 PyOS_snprintf(message,
sizeof(message),
28467 "compiletime version %s of module '%.100s' "
28468 "does not match runtime version %s",
28469 ctversion, __Pyx_MODULE_NAME, rtversion);
28470 return PyErr_WarnEx(NULL, message, 1);
28476 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28478 #if PY_MAJOR_VERSION < 3
28479 if (t->is_unicode) {
28480 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28481 }
else if (t->intern) {
28482 *t->p = PyString_InternFromString(t->s);
28484 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28487 if (t->is_unicode | t->is_str) {
28489 *t->p = PyUnicode_InternFromString(t->s);
28490 }
else if (t->encoding) {
28491 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28493 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28496 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28501 if (PyObject_Hash(*t->p) == -1)
28508 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
28509 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28511 static CYTHON_INLINE
const char* __Pyx_PyObject_AsString(PyObject* o) {
28513 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28515 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28516 #if !CYTHON_PEP393_ENABLED
28517 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28519 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28520 if (!defenc)
return NULL;
28521 defenc_c = PyBytes_AS_STRING(defenc);
28522 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28524 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28526 for (c = defenc_c; c < end; c++) {
28527 if ((
unsigned char) (*c) >= 128) {
28528 PyUnicode_AsASCIIString(o);
28534 *length = PyBytes_GET_SIZE(defenc);
28538 static CYTHON_INLINE
const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28539 if (unlikely(__Pyx_PyUnicode_READY(o) == -1))
return NULL;
28540 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28541 if (likely(PyUnicode_IS_ASCII(o))) {
28542 *length = PyUnicode_GET_LENGTH(o);
28543 return PyUnicode_AsUTF8(o);
28545 PyUnicode_AsASCIIString(o);
28549 return PyUnicode_AsUTF8AndSize(o, length);
28554 static CYTHON_INLINE
const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28555 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28557 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28558 __Pyx_sys_getdefaultencoding_not_ascii &&
28560 PyUnicode_Check(o)) {
28561 return __Pyx_PyUnicode_AsStringAndSize(o, length);
28564 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
28565 if (PyByteArray_Check(o)) {
28566 *length = PyByteArray_GET_SIZE(o);
28567 return PyByteArray_AS_STRING(o);
28572 int r = PyBytes_AsStringAndSize(o, &result, length);
28573 if (unlikely(r < 0)) {
28580 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
28581 int is_true = x == Py_True;
28582 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
28583 else return PyObject_IsTrue(x);
28585 static CYTHON_INLINE
int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
28587 if (unlikely(!x))
return -1;
28588 retval = __Pyx_PyObject_IsTrue(x);
28592 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result,
const char* type_name) {
28593 #if PY_MAJOR_VERSION >= 3
28594 if (PyLong_Check(result)) {
28595 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28596 "__int__ returned non-int (type %.200s). "
28597 "The ability to return an instance of a strict subclass of int "
28598 "is deprecated, and may be removed in a future version of Python.",
28599 Py_TYPE(result)->tp_name)) {
28606 PyErr_Format(PyExc_TypeError,
28607 "__%.4s__ returned non-%.4s (type %.200s)",
28608 type_name, type_name, Py_TYPE(result)->tp_name);
28612 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28613 #if CYTHON_USE_TYPE_SLOTS
28614 PyNumberMethods *m;
28616 const char *name = NULL;
28617 PyObject *res = NULL;
28618 #if PY_MAJOR_VERSION < 3
28619 if (likely(PyInt_Check(x) || PyLong_Check(x)))
28621 if (likely(PyLong_Check(x)))
28623 return __Pyx_NewRef(x);
28624 #if CYTHON_USE_TYPE_SLOTS
28625 m = Py_TYPE(x)->tp_as_number;
28626 #if PY_MAJOR_VERSION < 3
28627 if (m && m->nb_int) {
28629 res = m->nb_int(x);
28631 else if (m && m->nb_long) {
28633 res = m->nb_long(x);
28636 if (likely(m && m->nb_int)) {
28638 res = m->nb_int(x);
28642 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28643 res = PyNumber_Int(x);
28647 #if PY_MAJOR_VERSION < 3
28648 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28650 if (unlikely(!PyLong_CheckExact(res))) {
28652 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28655 else if (!PyErr_Occurred()) {
28656 PyErr_SetString(PyExc_TypeError,
28657 "an integer is required");
28661 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28664 #if PY_MAJOR_VERSION < 3
28665 if (likely(PyInt_CheckExact(b))) {
28666 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
28667 return PyInt_AS_LONG(b);
28669 return PyInt_AsSsize_t(b);
28672 if (likely(PyLong_CheckExact(b))) {
28673 #if CYTHON_USE_PYLONG_INTERNALS
28674 const digit* digits = ((PyLongObject*)b)->ob_digit;
28675 const Py_ssize_t size = Py_SIZE(b);
28676 if (likely(__Pyx_sst_abs(size) <= 1)) {
28677 ival = likely(size) ? digits[0] : 0;
28678 if (size == -1) ival = -ival;
28683 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28684 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28688 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28689 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28693 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28694 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28698 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28699 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28703 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28704 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
28708 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28709 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28715 return PyLong_AsSsize_t(b);
28717 x = PyNumber_Index(b);
28719 ival = PyInt_AsSsize_t(x);
28723 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(
long b) {
28724 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28726 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
28727 return PyInt_FromSize_t(ival);
Base class for linear operators. This class serves as interface for all derived classes.